{"slug": "what-i-keep-in-claude-md-and-what-i-stopped-putting-in-it", "title": "What I keep in CLAUDE.md, and what I stopped putting in it", "summary": "A developer documented a revised approach to maintaining CLAUDE.md files for Claude Code on a mixed Python and TypeScript codebase, cutting the file from roughly 300 lines to under 80 and organizing it into four sections. The developer reports that long files with contradictory examples caused the agent to pick conventions at random, and now caps routine replies at about 50 words to conserve context in long sessions. The file is reviewed in the same pull request as the code, with review-comment rationale moved into it, and the advice is to start with ten lines and add one only after the same mistake happens twice.", "body_md": "Writing a CLAUDE.md is easy. Keeping it useful three months later is the part nobody documents, so here is what changed for us after a few rounds with Claude Code on a mid-sized codebase that mixes Python services and a TypeScript frontend.\n\nFour sections, in this order:\n\nWe deliberately left out tutorials. Anything that repeats the README drifts out of sync with it and teaches the model the wrong version.\n\nThe file stayed under about 80 lines. The first draft was 300, and the results were worse. Long files with contradictory examples made Claude Code pick a convention at random, and the longer the file, the harder it was for a human reviewer to notice the contradiction. Every line we keep has to justify itself against a real mistake.\n\nContext accumulates: tool outputs, diffs, and repeated explanations. When working on a small, mechanical change, tell the agent to work in short, direct terms and skip restating the plan. We settled on a routine that caps each reply at roughly 50 words unless the task is exploratory. It fits especially well in long sessions, where verbose answers crowd out the code the model actually needs to read.\n\n`CLAUDE.md` goes through the same pull request as the code it describes. When a review comment explains why something must be done a certain way, that is a signal to move the reason into the file, not just resolve the thread. Over two months the file turned into a short, accurate record of our decisions, and answers about the project do not start from zero.\n\nI keep the same habit for my own notes on Python services: the checks I run before an upgrade live in [npmjs.com/package/uvicorn-teardown-notes](https://www.npmjs.com/package/uvicorn-teardown-notes), because writing them down was how I found out which ones I actually follow.\n\nStart with ten lines. Add one only after the same mistake happens twice. The file you end up with is smaller than you expect and used far more than the 300-line one.", "url": "https://wpnews.pro/news/what-i-keep-in-claude-md-and-what-i-stopped-putting-in-it", "canonical_source": "https://dev.to/xinyue_zhan_35ea4c0965196/what-i-keep-in-claudemd-and-what-i-stopped-putting-in-it-4kbf", "published_at": "2026-12-03 19:38:49+00:00", "updated_at": "2026-12-03 19:47:01.585094+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "large-language-models", "ai-tools"], "entities": ["Claude Code", "Anthropic", "Python", "TypeScript"], "also_reported_by": [], "takeaway": "Keeping CLAUDE.md under about 80 lines with four ordered sections and capping routine replies at roughly 50 words reduced contradictory guidance that made Claude Code pick conventions at random.", "recommendation": {"advice": "Keep CLAUDE.md under 80 lines, drop README-style tutorials, and add a line only after the same mistake happens twice.", "playbook": "coding-agents", "playbook_url": "https://wpnews.pro/playbooks/coding-agents"}, "alternates": {"html": "https://wpnews.pro/news/what-i-keep-in-claude-md-and-what-i-stopped-putting-in-it", "markdown": "https://wpnews.pro/news/what-i-keep-in-claude-md-and-what-i-stopped-putting-in-it.md", "text": "https://wpnews.pro/news/what-i-keep-in-claude-md-and-what-i-stopped-putting-in-it.txt", "jsonld": "https://wpnews.pro/news/what-i-keep-in-claude-md-and-what-i-stopped-putting-in-it.jsonld"}}