Yeda AI Tips · #201

Español

Score Your CLAUDE.md Like a Linter

Your CLAUDE.md is taxing every single prompt.

An instructions file like CLAUDE.md, AGENTS.md, or a system prompt is not free documentation. It's prepended to context on every turn of every conversation. Every contradictory rule, every vague platitude, every duplicated instruction gets re-read by the model on each message you send. That means bloat isn't just untidy — it inflates token cost and, worse, degrades the model's ability to follow the rules that actually matter. Treat the file like code and run a linter over it.

Why the file taxes every turn

Context isn't persistent memory; the whole instructions file is re-sent with each request. So a 4,000-token CLAUDE.md costs you 4,000 tokens on turn one and turn fifty alike. Two failure modes make this worse than the raw token count suggests:

The model's attention is finite. Filler dilutes the signal of the rules you care about.

The mechanism: score it out of 100

Run a rubric over the file, manually or with a quick script, starting at a perfect 100 and deducting:

Start:                      100
- each contradiction pair:  -10   (two rules that can't both hold)
- each redundancy cluster:  -5    (same instruction stated N times)
- each platitude:           -3    (no operational, checkable meaning)
- oversized (> ~2k tokens):  -10   (whole file re-sent every turn)

You can even have the model audit its own instructions: paste the file and ask "find every pair of rules that contradict each other, every cluster that repeats the same instruction, and every line with no checkable meaning." Then cut what lost points. Keep rules that are specific, non-conflicting, and stated once.

Before and after

SymptomCosts youFix
Contradictory rulesInconsistent behavior, wasted tokensKeep one, delete the loser
Repeated instructionRe-read every turn for no gainState it once, in one place
Platitude ("be thorough")Tokens with zero steeringReplace with a concrete, checkable rule
4k-token fileFull cost on every messageTrim to the load-bearing rules

A lean rules file means cheaper prompts and sharper adherence on every turn.

Power moves

Resources

Shipping AI or cloud systems? Yeda AI audits and hardens production LLM and agent pipelines. Talk to us · Read the blog