The line the Claude Code team types after every correction
When Claude Code gets something wrong and you fix it, one line makes Claude write a rule so the same mistake does not come back.
Why it matters
Boris Cherny, who created Claude Code, shared this as tip 3 from the Claude Code team.
CLAUDE.md is the notes file Claude Code reads at the start of every chat.
Claude writes the rule for itself. Then you keep the file short by editing it.
Do this
- Correct the mistake in the chat as you normally would.
- Then paste the line below. Claude adds a rule to your CLAUDE.md.
- Open CLAUDE.md and read the new rule. Make it specific, or delete it if it is too broad.
- Every few weeks, cut rules that stopped helping. Keep going until the same mistake stops coming back.
Paste this after a correction
Update your CLAUDE.md so you don't make that mistake again.
One thing to keep in mind: CLAUDE.md is advice, not a lock. Claude Code's docs say Claude treats it as context, not enforced settings. If an action must never happen, block it with a PreToolUse hook instead.
Short, specific rules get followed more consistently (Claude Code memory docs). Source: Boris Cherny (@bcherny) on X, Jan 31 2026, tip 3; Claude Code docs: memory.
Free live lesson · Nov 24Stop Measuring AI by Tokens. Measure What It EarnsOne hour, live, with Saurav. Bring your own bill. Free.Save my free seat → Learn it live, then run it yourselfLoop and harness engineering, AI agents on AWS, AI cost and ROI.See the workshops →
All tips in: Claude Code tips from the team that builds Claude Code