Token use of coding subagents, and the context window a local model needs
Daniel Mason
Abstract
Purpose: To measure token use of coding subagents and the context a local model needs. Methods: Token counts from the logs of 878 jobs: 487 by a local model (Qwen3.8-27B, 4-bit, llama.cpp) in headless Claude Code, 242 Claude subagents, 108 headless Claude Opus 5.5 jobs, 26 Grok and 15 Codex sessions. Results: 1.12 billion tokens read, 20.5 million written. Input grew with turns to the power 1.82. Local peak context: median 22K, maximum 96K. Conclusion: Turns, not window size, drive token use. 128K was enough for every local job.
Article type: Technical note
Author: Daniel Mason, DO. Abdominal radiologist, St. Louis; builder of OpenRADS.
Correspondence: [email protected]
Summary statement: In 878 AI agent jobs, most tokens were re-reads, and a local 27B model never used more than 96K of its 128K context.
Data collected: 29 August to 18 November 2026. Received: 17 November 2026.
Review: Technical note: checked by one editor, not peer reviewed. The author is also the editor; see Conflicts of interest.
Key results
- Agents read 46 to 116 tokens per token written.
- Doubling a job's turns multiplied its input by about 3.5.
- No local job used more than 96K of 128K.
Methods
Table 1. Setup.
| Component | Version |
|---|---|
| Directing agent | Claude Code desktop 5.11492.5 (Claude Code 2.1.325), Opus 5.5 |
| Headless Claude jobs | Claude Code CLI 2.1.322–2.1.325, Opus 5.5 |
| Claude subagents | Opus 5.5 (113), Haiku 5.5 (107), older (22) |
| Local model | Qwen3.8-27B 4-bit, llama.cpp, three 128K slots |
| Grok / Codex | Grok CLI 1.0.62; Codex CLI 0.162.1 |
| Workstation | Ryzen 9 9950X, 64 GB, RTX 5090 + RTX 5070 Ti |
| Second machine | Core i5-12600KF, 32 GB, RTX 4070 Ti + RTX 5060 Ti |
Per job: input (with cache), output, turns, peak context (largest single prompt). No transcript text, no patient data.
Results
Table 2. Tokens by worker type.
| Worker | Jobs | Median input/job | Total input | Input/output | Cached |
|---|---|---|---|---|---|
| Local model | 487 | 251K | 379M | 46 | 92% |
| Claude subagents | 242 | 268K | 337M | 59 | 92% |
| Headless Claude | 108 | 1.38M | 298M | 63 | 95% |
| Grok | 26 | 1.58M | 83M | 53 | 93% |
| Codex | 15 | 652K | 21M | 116 | 94% |
Figure 1. Total input by worker type.
Figure 2. Input vs turns, 304 local coding jobs, log scales. Slope 1.82.
Figure 3. Pass rate by turns, local coding jobs: 95.7% up to 40 turns, 87.1% above. Association only (19 failures).
Figure 4. Peak context, 284 local jobs. Compaction at 87K capped it; moved to 98K.
Compaction happened at 87K because the runner set Claude Code's window 11,072 tokens below the slot. It now uses the full slot (compacts at about 98K). Higher would let a compaction request overflow the slot.
Recommendations
- Keep the local slot at 128K. No job needed more; one in five used over 64K.
- Scope search subagents narrowly. They re-read their peak context a median of 16 times per job.
Limitations
One author's jobs, one run. Only local jobs have outcomes. Small Grok and Codex samples; no Grok peak; 203 local jobs lack a peak.
Conflicts of interest
The author built OpenRADS and the job runner, and edits the OpenRADS Journal. No financial relationship with Anthropic, OpenAI, xAI, Alibaba or DeepSeek.
Use of AI tools: Claude Opus 5.5 (Anthropic) in Claude Code wrote the scripts, ran the analysis and drafted the text. The author is responsible for the content.
Funding
None.
How to cite
Mason D. Token use of coding subagents, and the context window a local model needs. OpenRADS Journal. 2026.