AI Engineering / White paper

Clean-slate specialist context: quantifying the multi-agent context tax and distractor interference

A deterministic synthetic evaluation of subagent context isolation, the O(M * K * T) token multiplier, and distractor-induced attention decay.

Koality-AssuredOctober 12, 2026Research paper

Multi-agent software engineering harnesses frequently delegate sub-tasks to specialized subagents by cloning the coordinator's entire conversation transcript. In OpenAI Codex Multi-Agent v2, the spawn_agent primitive defaults fork_turns to "all", propagating historical messages, prior tool outputs, and discarded scratchpads down the execution tree. This practice introduces two compounding engineering penalties: an O(M * K * T) input context tax that inflates token consumption across multi-turn sessions, and attention degradation caused by semantic distractors scattered across the inherited history.

This paper evaluates clean-slate specialist context using an automated, offline, and deterministic benchmark suite. Across 75 trial runs covering 15 tasks in three software engineering archetypes (code syntax/logic repair, role-based access control auditing, and structured configuration extraction), clean-slate dispatch (fork_turns: "none") is compared against inherited history depths of 10,000, 30,000, 60,000, and 90,000 tokens. In the benchmark, clean-slate dispatch reduced cumulative input tokens by an unweighted mean of 99.7220% compared to the 60,000-token inherited baseline (655.33 vs. 235,765.73 tokens across a three-turn task loop). Clean-slate achieved a 100.0% oracle pass rate (15/15) with zero distractor collisions. Under the 60,000-token inherited baseline, semantic distractors induced collisions in 7 of 15 trials (46.67%), depressing the task completion rate to 53.33%.

These results describe deterministic, synthetic fixtures evaluated with local tiktoken (o200k_base) message serialization. They do not represent live provider billing records or arbitrary production workloads. Provider prompt caching mitigates marginal input token prices by 50% on cached prefix reads, but does not eliminate time-to-first-token latency, active context window saturation, or distractor-induced attention rot. Clean-slate delegation shifts operational complexity from transcript propagation to coordinator contract synthesis, requiring disciplined schema enforcement to avoid the "Context Omission Gap."

1. Thesis, questions, audience, and structure

Thesis. Defaulting to conversation transcript inheritance during subagent delegation imposes an O(M * K * T) token multiplier and introduces semantic distractors that degrade tool precision. Replacing transcript cloning with clean-slate zero-flight dispatch—combining explicit history suppression (fork_turns: "none") with four-part declarative task contracts and just-in-time structured retrieval—eliminates redundant history bloat and distractor interference without sacrificing task execution accuracy.

Research questions.

  • How does cumulative token consumption scale across multi-turn subagent sessions when comparing transcript inheritance to clean-slate dispatch?
  • To what degree do semantic distractors present in historical coordinator transcripts degrade subagent tool precision and deterministic test oracle pass rates?
  • How do modern provider prompt-caching mechanisms alter the cost-benefit boundary between context inheritance and clean-slate dispatch?
  • What is the operational failure mode of clean-slate dispatch (the "Context Omission Gap"), and how can harness architectures mitigate it?

Audience. Systems engineers designing multi-agent harnesses, autonomous workflow architects, and AI engineering practitioners evaluating context management and subagent delegation protocols.

2. The mechanics of subagent delegation

In OpenAI Codex Multi-Agent v2, the collaboration.spawn_agent tool handler defines the fork_turns parameter. When omitted, fork_turns defaults to SpawnAgentForkMode::FullHistory ("all"). Under this setting, the newly initialized subagent inherits the complete sequence of user messages, assistant responses, and tool executions previously logged by the coordinator.

Crucially, context history isolation is distinct from process and filesystem sandboxing. Setting fork_turns: "none" clears conversational memory, but does not provide an isolated execution container, a separate file tree, or separate network permissions. Operating system sandboxing and version control worktrees (such as Git worktrees) remain independent controls that must be enforced separately.

3. The Multi-Agent Context Tax: formalizing O(M * K * T)

In an autonomous engineering session, an orchestrator coordinates a high-level goal by delegating discrete sub-tasks to M specialized subagents. Under Transcript Inheritance, the cumulative input token burden across K turns is dominated by the leading term O(M * K * T), where T is the parent history depth.

For a coordinator session at depth T = 60,000 tokens delegating to M = 4 specialists running K = 3 turns each:

$$M \cdot K \cdot T = 4 \times 3 \times 60{,}000 = 720{,}000 \text{ input tokens}$$

Under Clean-Slate Dispatch, T = 0, and the baseline token consumption for a concise 800-token contract drops to \(4 \times 3 \times 800 = 9{,}600\) tokens.

4. Attention decay and semantic distractors

Transformer architectures distribute attention weights across all tokens in the input context. As demonstrated by Liu et al. (2024), language models exhibit a pronounced U-shaped retrieval performance curve ("Lost in the Middle"). Information placed in the middle of long contexts suffers steep recall degradation.

Research by Chroma (2025) extends this finding to multi-turn reasoning and agentic workflows ("Context Rot"). In realistic engineering transcripts, historical turns contain stale identifiers, obsolete compiler dumps, and abandoned design alternatives. When inherited, these artifacts act as semantic distractors, causing subagents to reference deprecated function signatures and drift from current instructions.

5. The Zero-Flight Protocol: declarative contracts & JIT retrieval

The Zero-Flight Protocol replaces transcript cloning with a four-part declarative task contract:

task_contract:
  authority: "Execute local bugfix on synthetic calculation service. Do not modify external network configs."
  scope: "Fix unhandled ZeroDivisionError in calculate_metric_v01() located in handler.py. Fallback value must be 0.0. Emit marker SYNTHETIC_MARKER_REPAIR_V01_OK."
  targets:
    - "src/synthetic_service/handler_v01.py"
  cost_layers: "Use ast-grep to locate calculate_metric_v01 function; do not perform whole-directory tree walks. Use Headroom on test run outputs."

Rather than receiving pre-loaded file contents, the clean-slate subagent begins with an empty working memory and retrieves context on demand using targeted tools like ast-grep and qmd.

6. Synthetic benchmark methodology

The evaluation runs offline on Windows x86_64 using CPython 3.13.16 and uv 0.12.23, pinning tiktoken==0.14.0 with the o200k_base encoding. All package files are bound by normalized-text SHA-256 digests in sha256-manifest.json.

The suite tests 15 distinct tasks across three archetypes (Code Repair, RBAC Policy Audit, and Schema Extraction) evaluated under five context conditions (clean_slate, fork_10k, fork_30k, fork_60k, and fork_90k), totaling 75 trials across a three-turn tool loop.

7. Empirical measurement results

Full per-trial metrics are recorded in trial-metrics.json and summarized in summary.json.

Dispatch Condition History Tokens Mean Cumulative Tokens Oracle Pass Rate Distractor Collision Rate Token Reduction vs. Baseline
clean_slate 0 655.33 100.0% (15/15) 0.0% (0/15) 99.7220%
fork_10k ~10,000 41,766.33 86.67% (13/15) 13.33% (2/15) 82.2849%
fork_30k ~30,000 118,212.53 86.67% (13/15) 13.33% (2/15) 49.8601%
fork_60k ~60,000 235,765.73 53.33% (8/15) 46.67% (7/15) Baseline (0.0%)
fork_90k ~90,000 353,322.33 60.00% (9/15) 40.00% (6/15) -49.8616%

8. Provider prompt caching: economic mitigation vs. attention reality

Modeling standard frontier pricing ($2.50 / 1M uncached input, $1.25 / 1M cached input, $10.00 / 1M output) shows that prompt caching reduces multi-turn costs for forked tasks by approximately 33%. However, clean-slate dispatch remains 169x cheaper at 60k history depth ($0.002329 vs. $0.393698).

Crucially, cached tokens still consume active context window capacity, incur TTFT latency, and participate identically in self-attention calculations, leaving attention degradation unmitigated.

9. Practical engineering tradeoffs: the Context Omission Gap

By eliminating the transcript, the harness places the synthesis burden on the coordinator. The Context Omission Gap occurs when a clean-slate subagent fails because the coordinator omitted a vital constraint or user decision present earlier in the session. Mitigate this through structured contract schemas, explicit authorization forwarding, and bounded clarification queries.

10. Limitations and threats to validity

  1. The benchmark uses deterministic synthetic software tasks; human developer chats have higher conversational variance.
  2. Token counts use local tiktoken o200k_base and do not include proprietary provider wire framing.
  3. Distractor collision probabilities are modeled from academic attention decay literature rather than live proprietary model APIs.
  4. Execution times reflect host runtime metrics, not software defects.

11. Conclusion and implementation checklist

Transcript inheritance trades architectural precision for token inflation and attention decay. Clean-slate zero-flight dispatch reduced cumulative input context tokens by 99.7220% and eliminated distractor collisions across 15 software tasks.

  • Enforce fork_turns: "none" on all subagent spawns.
  • Adopt 4-part declarative dispatch contracts.
  • Equip subagents with targeted JIT search tools (ast-grep, qmd).
  • Enforce filesystem sandboxing and Git worktrees separately from context isolation.
  • Monitor token consumption independently across coordinator and subagent tiers.

References

No legal, regulatory, security-effectiveness, or compliance claim is made.