Reducing an oversized CLAUDE.md

A box CLAUDE.md loads into the assistant's context on every single turn, before it knows what the task is. Every line competes with the actual work for attention. This is not just a memory cost: past a few thousand tokens, models reliably start dropping instructions — so a bloated CLAUDE.md makes the agent follow your rules less, not more. If the agent keeps ignoring a rule you wrote down, the file being too long is a likely cause: the rule is getting lost in the noise.

So the goal isn't a smaller file for its own sake — it's that the instructions that survive actually get followed. Below are the strategies, roughly in the order worth trying.

The one test to apply to every line

"If I deleted this line, would the agent start making a mistake it doesn't make now?"

If the answer is no, cut it. Most oversized CLAUDE.md files are mostly lines that fail this test: things the agent already does correctly without being told, restated conventions, reassurance, and explanation written for a human reader who isn't there. CLAUDE.md is instructions for an agent, not documentation for a person — it doesn't need an intro, a rationale for every rule, or a polished narrative. State the rule and move on.

Keep the strong rules strong

Not every rule is equal, and the file should show it. Most of a CLAUDE.md is ordinary statements the agent follows without fuss. A few are load-bearing: the agent's natural default is wrong, and getting it wrong is costly. Those must stand out — and they only stand out if you protect their signal.

1. Cut what the agent already knows or can see

The biggest wins are usually deletions, not relocations:

2. Consolidate duplication and overlap

Re-read the whole file looking for the same instruction stated in two places, or two rules that are really one. Oversized files accumulate near-duplicates as they're edited over time — a rule added at the top in one session and again in a section months later. Merge them into a single, sharper statement. One clear rule is followed more reliably than the same idea scattered across three paragraphs.

3. Tighten the language that remains

Once the content is right, the wording is usually still 2–3× longer than it needs to be. Compress aggressively:

4. Move separable detail onto a lazier surface

Anything that's only sometimes relevant should live where the agent loads it on demand — not in the always-on file. Replace the moved section with a one-line pointer that says where it went and what's there, so the agent knows to read it when the topic comes up. This is "progressive disclosure": tell the agent how to find the detail, instead of pre-loading all of it.

Where to move things, from lightest to heaviest:

5. Let an example carry the documentation

Often the clearest way to specify something is a small concrete example, and the example replaces the prose that would otherwise describe it. Instead of three sentences describing the shape of a card, a naming convention, or a command's output, show one correct instance and let it speak. A single well-chosen example is shorter than its description and less ambiguous — the agent pattern-matches off it. (Where the example is real and lives in the box, point at it by path rather than pasting a copy that will drift out of date.)

6. Prefer pointers to copies

Don't paste content that lives somewhere else and changes on its own — command output, file contents, a schema, a list that grows. It goes stale, and stale instructions are worse than none. Point to the source ("run bbx …", "see <path>") so the agent reads the current version when it needs it.

After trimming

Re-run bbx validate (or just save the file — the validation hook re-checks it) to confirm the warning clears. Treat CLAUDE.md like code you maintain: prune it whenever you notice the agent ignoring a rule, not only when the linter nags.