ce-code-review: the per-reviewer fixed read dominates review cost on stacked changes
Since #1890 (v3.32.0), every reviewer reads the shared references itself at the start: subagent-template.md (26 KB), findings-schema.json, diff-scope.md and action-class-rubric.md, about 11k tokens. We measured it on v3.33.1 (ce-code-review is unchanged through v3.36.1). It is paid once per reviewer, then multiplied by 8–10 reviewers and by every part of a stack that crosses the 200-line full-round floor:
- Stacked change of 6 PRs: 6 full rounds. About 600k tokens went to these references, against 126k for the diffs.
- Stacked change of 8 PRs: 5 full rounds. 595k of 1.47M subagent tokens went to references, and the session hit its usage limit.
Would either of these be in scope? (a) Give each persona only the slice of the template it uses (output contract plus its own rules). (b) For later parts of a stack whose earlier parts were already reviewed, use a lighter default. Related: #1831 (prompt size), #1910 (diff re-reads).
Measured this and tried a version of (a). We're not shipping it yet.
Cost. With Claude's tokenizer, the shared read is 11,740 tokens per reviewer: subagent-template.md 6,552, findings-schema.json 2,044, action-class-rubric.md 1,651, diff-scope.md 1,493. That matches your ~11k. These counts are each reviewer's first, uncached read; the same text is then re-read from cache on every later turn, which costs about a tenth as much per token.
What we tried. Reviewers stopped reading findings-schema.json and got a field list in the template instead. The slot table moved out of the template, and the schema's anchor-50 text was reworded to match the template. On Claude that saved 3,392 tokens of context per reviewer, the same across 3 runs.
Why it's not shipping. On Codex it hurt recall. We ran about 60 full mode:agent reviews on an eval fixture with a paywall bypass:
| Reviewers read the current schema text | Bug caught |
|---|---|
| Yes | 27 of 28 |
| No (reworded or not read) | 24 of 36 |
Bisecting points at the schema's anchor-50 description. It's out of step with the template, but Codex reviewers report this bug less often without it. Moving the slot table had no measurable effect on recall, and it saves only a few hundred tokens.
Codex saves almost nothing anyway. Codex keeps the start and end of any tool output over 10k tokens and drops the middle. Reviewers usually read all four files in one command, so before any change they were already losing 1.5k to 3.5k tokens from the middle of the template. Telling reviewers to read each file separately fixes that when the reviewer gets the instruction, but the Codex orchestrator often doesn't pass it on. Truncation in the orchestrator and the finish leaves is tracked in #2030.
On (b), lighter rounds for later parts of a stack would be a ce-work change. That's the bigger lever, and nothing here decides it.
Follow-up: I checked whether skipping repeat reads inside one session is worth it. The estimate was about 45k per round, for the orchestrator re-reading references on each review in a ce-work session.
I looked at real sessions on my machine that ran ce-code-review two or more times (eval runs excluded). Tokens are estimated as chars / 4.
| Claude | Codex | |
|---|---|---|
| Sessions with 2+ reviews | 11 | 44 |
| Repeat-read tokens, all sessions | ~89k | ~251k |
| Per extra review | 0 to ~10k | ~2k to ~25k |
| Worst session | ~23k over 3 reviews | ~50k over 3 reviews |
Most of the heavy repeaters compacted between reviews: 4 of the top 5 on Claude, 4 of the top 6 on Codex. After a compaction the reference text is gone, so reading it again is correct. A skip rule would only save the repeats in sessions with no compaction. That's a few percent of a round's ~190k fixed cost, and it depends on the model knowing whether the full text is still in context, which it can't reliably tell.
Not pursuing this one either. Most of a round's cost is in the reviewer and finish subagents, which start from a fresh context by design.