The most important file in your repo isn't code. It's a markdown file most engineers spend five minutes on.
I've been shipping agents into production for a while now, and the pattern is always the same: teams obsess over model selection, prompt templates, and framework choice, then throw together a CLAUDE.md or AGENTS.md in five minutes and wonder why their agent keeps going sideways.
Here's what Anthropic's own engineering team wrote about context engineering for agents: CLAUDE.md files get loaded into context upfront, forming the agent's persistent understanding of your project. Everything the agent does — every file it reads, every decision it makes, every line it writes — is filtered through that context. A bad CLAUDE.md doesn't just waste tokens. It actively misdirects the agent on every single action. (
anthropic.com/engineering/ef…)
And here's the finding that should change how you think about this: HumanLayer tested auto-generated CLAUDE.md files across a variety of repos. The LLM-generated ones actually hurt agent performance while costing 20% more in reasoning tokens. Agents spent 14-22% more tokens processing the instructions, took more steps to complete tasks, ran more tools — and didn't improve resolution rates at all. Auto-generated context files were worse than no context file. (
humanlayer.dev/blog/skill-is…)
Let that sink in. The most natural thing to do — "let AI write its own instructions" — makes the agent worse. Hand-crafted context beats generated context. Every time.
Why? Because effective context engineering is about what you leave OUT, not what you put in. A 200-line CLAUDE.md that covers your entire tech stack, coding conventions, testing rules, deployment procedures, and API patterns burns context on every session whether those rules are relevant or not. Your React patterns load when you're debugging a database migration. Your deployment rules load when you're writing unit tests. The agent drowns in irrelevant instructions.
The best practice from teams actually shipping agents at scale — Salesforce, the GitHub trending repo on agentic engineering (69 tips, input from the engineer who built Claude Code), and the practitioners I work with:
Keep CLAUDE.md under 200 lines. Make it a router, not an encyclopedia. Point to task-specific docs that load on demand. If you do something twice, make it a slash command. If a rule only applies to one domain, put it in a skill file, not the root context. Swallow passing test output and only surface errors — 4,000 lines of passing tests flooding the context window causes the agent to hallucinate. (
claudefa.st/blog/guide/devel…)
The parallel to Salesforce's 18x acceleration is exact. Their 231-day migration done in 13 days didn't come from a better model. It came from rule-based frameworks, reference implementations, and feedback loops — all of which are context engineering. They told the agent what "correct" looks like, gave it examples, and built a system where every PR review improved the next run. That's a CLAUDE.md philosophy, not a prompt philosophy. (
salesforce.com/news/stories/…)
Context engineering is the new meta-skill of AI-assisted development. It can't be automated (automating it makes it worse). It requires deep understanding of your codebase (what matters, what doesn't, what the agent needs to know RIGHT NOW versus what it can discover on its own). And it's the single biggest determinant of whether your agent is a productivity multiplier or an expensive token-burning machine.
The irony: the skill that matters most in AI-assisted engineering is writing clear, structured prose in a markdown file. The age of "just write code" is over. Now you have to write the context that makes the code possible.
Your CLAUDE.md is your real codebase. Treat it like one.