✨ Visual Editor

close

Thread Truncated

Only the first 20 tweets are shown to ensure high-quality rendering and prevent image size issues.

palette Canvas & Background

Gradient:arrow_forward
Text Color:
135°

style Card Style

40px
16px

text_fields Typography

16px
darkzodchi
@zodchiii
Have you ever told Claude Code to do something and it just didn't?
Thread image
darkzodchi
@zodchiii
You said format the code - It didn't. You said don't touch that file - It did.
darkzodchi
@zodchiii
You said run tests before finishing - It forgot.
darkzodchi
@zodchiii
That's because CLAUDE.md is a suggestion.
darkzodchi
@zodchiii
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.
darkzodchi
@zodchiii
Below I will share 8 personal hooks you can copy straight into your settings.json and never think about again 👇
darkzodchi
@zodchiii
Before we dive in, I share daily notes on AI & vibe coding in my Telegram channel: https://t.me/zodchixquant🧠
darkzodchi
@zodchiii
Thread image
darkzodchi
@zodchiii
## How hooks work (30-second version)

What are hooks?
darkzodchi
@zodchiii
Hooks are automatic actions that run every time Claude Code does something, like editing a file or running a command.
darkzodchi
@zodchiii
You set them up once and they work in the background without you thinking about it.
darkzodchi
@zodchiii
The two you'll use most:
darkzodchi
@zodchiii
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.
darkzodchi
@zodchiii
PostToolUse runs after Claude does something. You can run cleanup, formatting, tests, or logging. Think of it as quality control on the assembly line.
darkzodchi
@zodchiii
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)
darkzodchi
@zodchiii
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.
darkzodchi
@zodchiii
darkzodchi
@zodchiii
Thread image
darkzodchi
@zodchiii
## 1. Auto-format every file Claude touches
darkzodchi
@zodchiii
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
100%
view_carousel Carousel Studio NEW
Press + S to quick-export