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
- 'Let an agent run wild on vague goals and it makes your code worse 9 out of 10 times' — eptwts · 2026-10-27
- LangChain to demo the in-house design agent its team uses daily, this Wednesday — LangChain · 2026-10-27
- Biotech Agent Series Day 8: A Notebook Review Agent to Auto-Audit Lab Records — nlarusstone · 2026-10-27
- Photon Launches Agent-to-Agent Messaging in iMessage for Real AI Collaboration — alvelda · 2026-10-27
- Fake-paper meme shows an agent workflow for reverse engineering trading systems into a one-person quant fund — PtrPomorski · 2026-10-27
- Codex clones Linear's core from a one-page spec in 3 minutes 28 seconds — aakashgupta · 2026-10-27