Stop Losing Context by Avoiding Four Mistakes When Applying CLAUDE.md File Best Practices
A crowded or stale CLAUDE.md can send a build session in the wrong direction. These four fixes keep project instructions useful without turning them into a diary.
An outdated instruction can send Claude Code through the wrong files, lead it to repeat a rejected approach, or cause it to miss a test you meant to run. That happens when a CLAUDE.md file becomes a dumping ground or goes untouched as the project changes. The best practices for this file are simple: keep durable instructions specific, check that they still apply, and store changing project state elsewhere.
Claude Code uses CLAUDE.md for project guidance. Treat it as instructions for working in the codebase, not as proof that every generated change is correct. These four mistakes are worth checking before your next build session.
Mistake 1: putting the whole project history in CLAUDE.md
After a few productive sessions, it is tempting to paste every decision, prompt, and unfinished idea into the file. The important instruction then competes with yesterday's debugging notes. Claude may have more text to work through while you have a harder time spotting what still matters.
Keep rules that should guide repeated work, such as where a feature belongs, how to run a relevant test, and which established pattern to follow. Move temporary state into a short session note. For example, record “invite form validation remains untested” as a next action rather than making an unfinished task sound like a permanent coding rule.
Mistake 2: writing vague preferences instead of usable instructions
“Make the code clean” leaves a lot of room for interpretation. A builder writes it because the preference feels obvious, but it gives the tool little help when choosing between two plausible implementations. The result can be a new pattern that does not fit the rest of your app.
Replace broad preferences with observable guidance. You might write, “Before adding a new form component, inspect the existing form in src/components and follow its validation pattern.” Point to a real location in your own repository, and remove the instruction if that location changes. A compact, accurate example is more useful than a long list of adjectives.
Mistake 3: leaving obsolete decisions in place
A file that was accurate when you started can quietly become misleading. Perhaps you moved an API route, replaced a data model, or decided against the abstraction your instructions still recommend. Future sessions may then recreate work you already rejected.
Review CLAUDE.md when a meaningful project decision changes. Delete superseded instructions rather than appending a correction underneath them. If the reason for a decision may matter later, save that reason in your project notes and keep the file focused on the rule that applies today. This takes less effort than debugging a change built around an old assumption.
Mistake 4: treating instructions as a substitute for review
A good file can tell Claude Code where to look and what to try. It cannot establish that an auth change is safe or that a destructive action behaves correctly. Trusting the instructions instead of checking the result lets AI-generated bugs travel with an apparently tidy workflow.
Before accepting a change, inspect the diff and run the tests that cover it. For sensitive work, check auth flows, database writes, secrets, and destructive actions directly. Ask the tool to explain an unfamiliar edit, then verify that explanation against the code. If a test reveals a recurring project rule, add the concise rule to CLAUDE.md after you understand the failure.
Recover a useful file before your next session
Open CLAUDE.md and remove anything that is obsolete, temporary, or too vague to guide a concrete choice. Leave the durable instructions you would want on your first day back in the codebase. Put today's unfinished work and any prompt worth reusing beside the project instead of burying them in the instruction file.
Keep your session notes and reusable prompts in VibeCrumbs while CLAUDE.md stays focused on how to work in the repository.
