When Claude makes a mistake, don’t just correct it. Make it permanent. Tell Claude to update its own instructions so the mistake never happens again.
The Pattern
After correcting Claude:
Update your CLAUDE.md so you don't make that mistake again.
Claude will add a rule to the project’s CLAUDE.md file. Next session, it reads those instructions on startup and avoids the mistake from the start.
Examples
After Claude uses the wrong test runner:
“We use vitest, not jest. Update CLAUDE.md.”
Claude adds: Always use vitest for testing. Do not use jest.
After Claude modifies a generated file:
“Don’t edit files in src/generated/, they get overwritten. Add that to CLAUDE.md.”
Claude adds: Never edit files in src/generated/. These are auto-generated and will be overwritten.
After Claude uses a deprecated pattern:
“We moved off Redux to Zustand last month. Update CLAUDE.md so you use Zustand for state management.”
Via Code Review
If you use the Claude Code GitHub Action, you can tag @claude in PR review comments to update CLAUDE.md as part of the review process, capturing team conventions as they emerge.
Keep It Lean
Periodically review your CLAUDE.md. Remove rules for issues that have been fixed in the codebase itself, and consolidate redundant entries. Target under 200 lines.