Harness re-injects identical context blocks (task-list snapshots ×15, 18k tool-schema delta ×2, skill bodies ×5) with no change detection

Open 💬 2 comments Opened Jul 1, 2026 by LymanBE

Summary

Analyzing token flow across four real sessions (~1.2M injected tokens measured from transcript JSONL), several harness-injected context blocks are re-sent verbatim, with no change detection, inside single sessions. Each injection is appended to the conversation, so identical re-injections permanently grow the input carried by every subsequent request in the session — pure cost with no information gain.

Observed duplicate classes (one session each unless noted)

  1. Task-list reminder snapshots — the periodic "task tools haven't been used recently" reminder embeds all task subjects+descriptions verbatim every time. Observed: the same snapshot ×15, ×6, ×6, ×6, ×4 within one session; 178 snapshots across 4 sessions ≈ 559k tokens (46% of all dynamically injected content). A hash/change check — or injecting only changed tasks — would eliminate most of it.
  1. Deferred-tool schema deltas (ToolSearch) — an 18.1k-token schema delta was injected twice, byte-identical, in one session. Already-delivered schemas could be tracked per session.
  1. Invoked-skill content — the same skill body re-injected ×5 in one session (≈20k tokens) when the skill was re-invoked; a "already in context" check would cover it.
  1. Skill-availability lists — 61 re-injections across 4 sessions (≈64k tokens), most identical to the previous injection (no skill set change).

Environment

Claude Code v2.1.198+, macOS (darwin). Measurements: category-classified <system-reminder>/attachment records from session JSONL; tokens estimated chars/3.5 (relative ranking, not exact).

Suggested direction

Per-session content-hash de-dup for harness injections (task snapshots, tool-schema deltas, skill bodies, skill lists), or delta-only injection for the task list. Even a "skip if identical to last injection of same class" check removes the worst offenders (×15 identical snapshots).

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗