Stop putting rules in CLAUDE.md: use Claude Code hooks for deterministic tasks
Pretend_Sell6592 · reddit · 2026-09-07
A developer shares a workflow realization: rules like "run the formatter after edits" or "don't touch this file" were sitting in CLAUDE.md, relying on Claude to remember them. Claude Code's hooks can instead enforce these deterministically at session checkpoints.
- CLAUDE.md is for context Claude needs to understand
- Hooks are for things that must always happen: auto-format after edits, block changes to protected files, run checks before commands, or notify you when Claude is waiting
The takeaway: if a rule is deterministic, let the tooling enforce it instead of trusting the model to comply.
More from coding & agent
- SocialCrawl MCP lets agents search Reddit, YouTube, TikTok, X with one API key — dooddyman · 2026-09-11
- Astra builds a surprisingly polished Catan game in three.js, reusing past UI and 3D assets — FinanceYF5 · 2026-09-11
- Open-Source Tool Highlights the Exact PDF Paragraphs Behind AI Answers — Flat-Phone-1596 · 2026-09-11
- OpenAI Codex may issue another usage reset this weekend, says Codex lead resets happen — umesh_ai · 2026-09-11
- Dev swaps gemini-3.8 for gemini-3.5-flash-lite in his MCP harness at a fraction of cost — julianharris · 2026-09-11
- OpenAI opens Agents API public beta, exposing the infrastructure behind Codex and ChatGPT — The Decoder · 2026-09-11