The Cache Is Not the Only Token Budget
A redundant 964-byte path block reached the model 50 times in one session. The fix was not compression after the fact, but removing redundant context at the emitter.
Retiring a duplicated instruction file on 20 September removed about 7,000 tokens per request, which we have not measured.
Part 4 of 4 in Token reduction. Previous: Our Panel Said Enforced for Six Days · Next: none yet
On 20 September we retired a file that every Claude Code run under our home directory loaded twice. The panel records the saving as "about 7k tok/request". We have not measured that number. This post explains why the cut is still worth making, and why we cannot yet say how much it saved.
The panel's account is that Claude Code version 2.1.277 and later loads an AGENTS.md file as project instructions when no CLAUDE.md sits at or above the working directory. Under our home directory, that meant the same rules arrived twice. We have not verified that version behaviour in this post. We are reporting the panel's explanation.
The same day we retired AGENTS.md, set claudeMdExcludes so the file is not loaded, and cut the gated prose in three sections of our global instructions to one-line rules. The old instructions are kept in a backup folder under the work directory. We did not open the backup for this draft.
The number we can check is smaller than the one in the panel. On 26 July the wiring receipt counted the skill list: 40 skill descriptions come to about 4,600 tokens, and they sit in the system prompt of every request in a run. So a 7,000-token duplicate would be bigger than the whole skill list.
The receipt also records that a cached prompt read costs about 0.1 times the base rate after the first write. If the duplicate sat in the cached prefix, each request paid roughly 700 token-equivalents for it after the first write (7,000 times 0.1). That is a bill, but a small one.
The room is another matter. A cached token still takes up space in the context window on every request. Caching lowers the price of those 7,000 tokens. It does not give the room back. A context window has a fixed size, so every token spent on a duplicate rule is a token not spent on the file the model is editing. Our sources say nothing about whether that changes answer quality.
Nothing we opened replays a run from before 20 September and a run after it. The 7,000 figure is an estimate written into the panel. We have no count of input tokens per request before the cut, no count after it, and no count of cached reads. The skill-list figure is a count, but it is a different file.
We also did not check whether the duplicate was present in every run or only in some of them. The panel's wording suggests every run under the home directory, which would be a narrower set than every run on the machine.
Replay a set of recorded requests from before the cut and the same set after it, then count the input tokens and the cached-read tokens per request. Count cached reads separately, because the duplicate's price depends on whether each request read it from the cache, not only on whether it was present. The panel does not have that log. Of the numbers it is missing, this is the one that would settle the estimate.
How much of the prefix is copies of the same rule? We found this duplicate by reading the list of loaded files, not by counting bytes. There may be other duplicates that the file list does not show, and we have not looked for them.
/home/mario/Brain/OS/token-reduction-panel.md, lines 69 (the 20 September entry: AGENTS.md retired, claudeMdExcludes set, the 7k estimate, and the backup location)./home/mario/Brain/OS/2026-07-26-tooling-wiring-restored.md, lines 74 to 79 (the 40 skill descriptions at about 4,600 tokens per session, and the cached read at about 0.1 times).
Komentarze
Brak komentarzy.
Zaloguj się aby skomentować.