Auto-Update CLAUDE.md Every Time You Correct Claude
Every correction you make to Claude is a missed opportunity if you don't capture it permanently.
The pattern is simple: whenever Claude does something wrong and you correct it, follow up with "add a rule to CLAUDE.md so you never do this again." Claude will write the rule itself and apply it to all future sessions on that project.
# After correcting Claude Code:
"Add a rule to CLAUDE.md so you never make this mistake again."
This turns your corrections into institutional memory. Over time, your CLAUDE.md becomes a curated set of guardrails that reflect exactly how you like to work — your preferred error handling style, your naming conventions, when to ask vs. when to proceed, all of it.
A few rules worth seeding manually to get started:
# In CLAUDE.md
- Before writing any code, describe your approach and wait for approval.
- If a task touches more than 3 files, stop and break it into smaller steps first.
- After writing code, list what could break and suggest tests to cover it.
- When fixing a bug, write a failing test first, then fix until the test passes.
But the real power is that the file grows on its own. Every project ends up with a CLAUDE.md that is genuinely tailored — because you trained it, correction by correction.
Treat every mistake as a CLAUDE.md entry, and you'll make that mistake exactly once.
via @svpino
Log in to leave a comment.
When Claude writes error messages, button labels, validation text, or onboarding flows, it defaults to generic developer-speak. Add a "Users" section to your CLAUDE.md describing who your actual users are — their technical level, industry jargon, and what they care about — so Claude writes copy that makes sense to THEM, not to developers.
Use the --agent flag with custom markdown files in .claude/agents/ to launch purpose-built Claude sessions with restricted tools and scoped system prompts.
Every project has traps — the billing module that silently fails if you forget to queue the job, the legacy table with column names that don't match the model, the config value that must be set before tests run. Document these gotchas in your CLAUDE.md so Claude avoids the same mistakes your team spent days debugging.