Have you ever told Claude Code to do something and it just didn't?

You said format the code - It didn't. You said don't touch that file - It did.
You said run tests before finishing - It forgot.
That's because CLAUDE.md is a suggestion.
Claude reads it and follows it about 80% of the time. Hooks are different. They're automatic actions that fire every time Claude edits a file, runs a command, or finishes a task.
Below I will share 8 personal hooks you can copy straight into your settings.json and never think about again 👇
Before we dive in, I share daily notes on AI & vibe coding in my Telegram channel: https://t.me/zodchixquant🧠

## How hooks work (30-second version)
What are hooks?
What are hooks?
Hooks are automatic actions that run every time Claude Code does something, like editing a file or running a command.
You set them up once and they work in the background without you thinking about it.
The two you'll use most:
PreToolUse runs before Claude does something. You can inspect the action and block it by returning exit code 2. Think of it as a bouncer.
PostToolUse runs after Claude does something. You can run cleanup, formatting, tests, or logging. Think of it as quality control on the assembly line.
Where hooks live:
.claude/settings.json project-level (shared via git)
~/.claude/settings.json user-level (all your projects)
.claude/settings.local.json local only (not committed)You configure them in .claude/settings.json in your project root. That file gets committed to git, so your whole team gets the same hooks automatically.
Full documentation: https://code.claude.com/docs/en/hooks

## 1. Auto-format every file Claude touches
The problem: Claude writes correct code that breaks your formatting rules. You add "always run Prettier" to CLAUDE.md and it works most of the time, but not always.
Generated by Thread Navigator
Press ⌘ + S to quick-export
