SWE-bench Verified, live, four arms: 13% cheaper than no compaction, and the highest reward. See the numbers

Benchmark: context-guru vs headroom vs rtk vs baseline

SWE-bench Verified · 50 tasks · claude-code agent on aws/claude-sonnet-5, run live. All 50 tasks scored (no infrastructure exception) under all four arms, so every number below is apples-to-apples on the same tasks. Reproduce: REPRODUCE.md. Per-config detail: baseline.md · context-guru.md · headroom.md · rtk.md. Component internals & real examples: components.md.

Three of the four arms are compaction layers of two different kinds:

Cache-aware billed input cost = fresh $2/M · cache-read $0.20/M · cache-write $2.50/M, recomputed from each trial's own token tiers; output billed at $10/M. Total adds the tool's own compaction-LLM cost.

These figures record what ran, and the comparison against headroom and rtk is apples-to-apples. The shipped codesmart pipeline has changed since, so a claim about today's default needs a re-measurement — see Benchmarks.

Headline

context-guru is the cheapest and highest-reward arm — but the striking result is that rtk, a simple deterministic shell filter, is the 2nd-cheapest arm and beats the sophisticated headroom proxy on both cost and reward, at zero request-path latency and zero tool cost.

headline

dimension baseline off context-guru headroom rtk winner
reward (solved / 50) 43 (86%) 44 (88%) 40 (80%) 43 (86%) context-guru
total billed cost $31.98 $27.77 (−13.2%) $30.30 (−5.3%) $29.09 (−9.0%) context-guru
cache-read tokens 102.8M 84.5M (−17.8%) 96.4M (−6.3%) 91.7M (−10.8%) context-guru
cache-write tokens 1.855M 1.847M 1.839M 1.835M ≈ tie (all within 1.1%)
cache-read $ $20.57 $16.90 $19.28 $18.33 context-guru
cache-hit rate 98.14% 97.73% 98.01% 97.94% ≈ tie
mean steps / task 36.1 31.1 35.1 33.2 context-guru
mean agent wall / task 380 s 352 s 364 s 384 s context-guru
compaction added latency / req 117 ms 63 ms 0 ms rtk
tool's own LLM cost $0 $0.31 $0 $0 rtk / headroom
content removed (per req) 0 1.09% 2.64% 65.8% of bash only — (different denominators)
exceptions (of 50) 0 0 0 0 tie

The content removed row is not comparable across the two kinds: context-guru/headroom measure removal against the whole request; rtk's 65.8% is of bash output only (its bytes/4 estimate), a small slice of a ~98%-cached agent's context — which is exactly why its 65.8% bash reduction nets to −9% on the bill, not −66%.

Verdict

Why the ranking comes out this way

Cost decomposition

Where every dollar goes (matched total): cache-read is the dominant term on a ~98%-cached agent. context-guru shrinks it the most (at a $0.31 haiku bill); rtk shrinks it deterministically for free; headroom shrinks it least of the three compaction arms.

cost decomposition

Per-task

Per-task billed cost (baseline ◆ · headroom ● · context-guru ● · rtk ■) and the per-task deltas vs baseline — context-guru is at/below baseline on nearly every task:

per-task cost per-task cost delta per-task step delta

Per-component / per-compressor

context-guru's savings come from extract_llm (LLM skeletonization of large file reads/logs) + the deterministic extract (ANSI/CR + noise) + cmdfilter/dedup; headroom's from its deterministic text and code_aware (AST) compressors; rtk's from catread file skeletonization (62%) and grep grouping/truncation (24%), then git / ls / pytest. Cumulative vs unique tokens (context-guru re-applies the same compaction every turn, so cumulative ≫ unique):

components

Full component internals, trigger conditions, and real before→after examples for all three tools are in components.md.