Skip to content
RCreddit.com·

One Claude Code feature I was underusing: hooks

AI summary

A developer discovered they were underutilizing Claude Code's hooks feature. Previously, they relied on CLAUDE.md for rules like "run the formatter after edits" or "don't touch this file." However, hooks can automate these tasks, such as formatting files post-edit, blocking changes to protected files, or running checks before commands. The key distinction is that CLAUDE.md is for Claude's understanding, while hooks are for deterministic actions that need to occur every time, making the tooling enforce rules rather than relying on Claude to remember them.

Time & source
Published
Sep 7, 2026, 15:43
Source type
Dev community
Tier
Community
Source status
Healthy
Tier is a per-source editorial setting, not a per-item score.

Times shown in UTC

More details
First seenSep 7, 2026, 19:00Time zoneUTC · UTC+0
Article

I used to put a lot of rules in CLAUDE.md like “run the formatter after edits” or “don't touch this file” and just trust Claude to follow them.Turns out some of that probably shouldn't be an instruction at all.Claude Code has hooks that can run automatically at different points in a session. So you can do things like format a file after Claude edits it, block changes to protected files, run checks before certain commands, or even get a notification when Claude is waiting for you.The useful distinction for me is this:CLAUDE.md is good for things Claude needs to understand.Hooks are better for things that simply need to happen every time.I've started looking at a few of my project rules differently because of that. If something is deterministic, relying on Claude to remember it feels unnecessary when the tooling can enforce it instead.

Source·reddit.com·Full text via RSS