Planning · Agent context

Take the free 14%, then measure

propflowai/CLAUDE.md is 2,088 lines — about 82,000 tokens — loaded into every session before anyone types. An earlier draft of this plan proposed cutting that to ~8k "without degrading." That claim was too strong. This revision separates the part that is genuinely free from the part that is a real trade, and names the four situations where Claude will not see a relocated rule.

Recommendation

Move the reference tier only — 11,210 tokens, 14% of the file, none of which carries a behavioural rule. Then stop and measure whether adherence changes before touching anything that does.

The aggressive migration to ~8k is achievable, but it buys tokens we are not currently short of and costs four specific failure modes. That trade should be made on evidence, not on general guidance.

11,210 tokens removable with zero behavioural risk — pure reference content
4 situations where a path-scoped rule silently fails to load
8% of the 1M context window this file occupies — the guidance assumes far worse

01The urgency is lower than the guidance implies

Anthropic's documented target is under 200 lines per CLAUDE.md, with the stated failure mode that "important rules get lost in the noise." At 2,088 lines we are ten times over. But that guidance is calibrated against the 200k default context window, where this file would consume 41% of everything available.

We run Opus 5 with a 1M window. The same file is 8%. That does not make the guidance wrong — noise-induced rule-skipping is real and is the reason the target exists — but it does mean the case for an aggressive migration rests on an adherence problem we have not measured, not on a context shortage we can demonstrate.

02Two tiers, not one plan

Tier 1 · free

Reference content

11,210 tokens · 14% of the file
  • Environment variables — 4,657
  • Project structure — 2,993
  • API endpoints — 1,880
  • Dashboard pages — 1,141
  • Demo / seed data — 539
No trigger can fail, because none of it is a rule. Claude re-derives all of it from the tree. This is the class /doctor flags for trimming.
Tier 2 · a trade

Behavioural rules

~63,000 tokens · voice, testing, temporal, UI, PMS, spine
  • Loads only when a matching file is read
  • Absent during planning, before any read
  • Lost after compaction until re-read
  • Never simultaneous across subsystems
Real savings, real regression modes. Defer until Tier 1 has been live long enough to show whether adherence moved at all.

A third, unmeasured saving sits alongside Tier 1: incident forensics into HTML comments. Block-level comments are stripped before injection, so they cost nothing and stay on disk verbatim. The file carries 27 narrative markers — History:, PR #…, "caught the hard way" — which are justification rather than instruction. Keep one why-clause inline, comment out the archaeology.

03Where Claude will not see it

Path-scoped rules load when Claude reads a matching file. Everything below follows from that one sentence. These are the honest costs of Tier 2.

1

Planning turns — before any file is read

Our workflow is explicitly plan-first: Hot Rule 8 is "plan before multi-file work", and the ultrathink-first skill demands a written plan before the first edit. Planning happens before reads, so path-scoped rules are structurally absent at exactly the moment the most consequential decisions get made.

This is the strongest argument against the aggressive migration.

2

Creating a new file

A brand-new .tsx is written, not read, so the UI rule never fires and Claude reaches for a raw <table> instead of the arsenal primitives — precisely the bug the section was written to prevent. A tripwire line in the digest points at the rule, but a pointer is not the content.

3

After compaction

Rules with paths: are dropped and only return when a matching file is read again. In a long session an edit often follows a read from before the compact, so the reload may never happen. Root CLAUDE.md and unscoped rules are re-injected from disk; scoped ones are not.

4

Cross-cutting changes

A change spanning voice, temporal and tests loads three rule files at three different moments, in whatever order files happen to be opened. Today all of it is present from turn one. Part of the monolith's value is simultaneity, and no scoping mechanism preserves that.

Compaction survival — the mechanic behind failure mode 3
MechanismAfter compaction
Project-root CLAUDE.md, unscoped rulesRe-injected from disk
Auto memoryRe-injected from disk
Rules with paths:Lost until a matching file is read again
Nested CLAUDE.mdLost until a file in that directory is read again
Invoked skill bodiesRe-injected — capped 5k tokens/skill, 25k total, oldest dropped first

The documented remedy is blunt: if a rule must persist across compaction, drop the paths: frontmatter or move it to the project-root file. So every invariant whose violation is a bug — one source of truth, no fabricated numbers, no arms by default — has to stay always-on regardless of how far the migration goes.

04Three mechanics worth knowing regardless

@path imports save nothing

The obvious refactor — split into files, import them back — buys organisation and exactly zero tokens. Imports expand and load at launch alongside the file referencing them, to a depth of four hops. Worth knowing before anyone spends a day on it.

Skill bodies truncate from the bottom

After compaction a skill is re-injected but capped at 5k tokens, keeping the start of the file. Any runbook we convert must be ordered most-important-first as a correctness requirement, not a stylistic one.

The skill listing is a fixed, competitive budget

We have 33 project skills plus roughly 100 user and plugin skills. The listing budget is 1% of the context window, and on overflow descriptions are dropped least-invoked first. Converting sections into skills therefore does not add tokens — it competes for a capped pool, and can silently strip the description off /smith-review or /pull-link so they stop auto-triggering. That is a quality risk, not a token risk, and it needs a /doctor reading before and after.

05What to do now

  1. Baseline. Record /context figures and /doctor's skill-listing estimate, so any later claim about improvement has a before.
  2. Move Tier 1 to docs behind a pointer. Five reference sections, 11,210 tokens. Nothing behavioural moves.
  3. Comment out the forensics. 27 narrative markers into HTML comments — zero context cost, fully preserved on disk.
  4. Run it for a few weeks. Normal work, normal sessions.
  5. Then judge. Did anything get worse? Did anything get better? If the file was never hurting us at 8% of a 1M window, Tier 2 is a trade with no upside to pay for it.

How to tell whether it degraded

06If Tier 2 is ever taken on

The placement rule, kept here for when the evidence justifies it. Ask in order, stop at the first yes.

QuestionDestination
Would violating it be a bug even if Claude never opens a matching file? Root CLAUDE.md — survives compaction, reaches custom subagents
Must it hold every time, regardless of judgement? A hook. Prose is advisory; "never push without asking" and "never run seed" are enforcement
Is it detail that only matters once you are already in the file? .claude/rules/*.md with a paths: glob
Is it an invoked procedure with a name? A skill, most-important-instructions first
Is it incident forensics or justification? An HTML comment — zero tokens, preserved verbatim

One further caveat for whoever picks this up: the built-in Explore and Plan subagents skip CLAUDE.md and rules entirely, with no setting to change it, and we lean on them heavily. That is true today as well, so it is not a regression — but it means conventions a subagent must honour belong in the delegation prompt or a custom agent's skills: preload, never in a rule.

07Measurement appendix

FigureValueMethod
File size2,088 lineswc -l
207,200 byteswc -c
26,183 wordswc -w
Token cost~82,160File reader; 2.52 bytes/token
Tier 1 reference11,210 tokSection extraction at the same ratio
Fully-migrated keep-list8,328 tokSame, incl. ~20 tripwire lines
Top ten sections1,142 lines55% of the file
Incident markers27Regex over narrative phrases
Share of 1M window8%82,160 / 1,000,000

Worth noting from the extraction: ## Important Rules is 19 lines but 2,388 tokens — 126 tokens per line. Line count is a poor proxy for context cost in this file, and any future trim should be judged on bytes, not lines.

PropFlow Docs