Case study · Round 2Counterfactual replay · rclm 0.1.35Snapshot 2026-10-26 23:53 UTCCompare with Round 1 (16.46%) →

Token savings from tool-output reduction (Round 2).

A 50-session counterfactual replay after expanding ReclaimLLM's tool-output pipeline with native output shaping, provider canonicalization, deterministic edit receipts, and stateful deltas.

Cohort
Latest 50 eligible org sessions (70 considered)
Organization
Two-user software organization (team/org scope)
Runtime & tokenizer
rclm 0.1.35 · o200k_base
Metric
Text tool-result tokens (tool outputs) · no dollar conversion

Executive result

3,278,328

of 13,420,338 text tool-result tokens removed

24.43%

text tool-output reduction (up from 16.46% in R1)

32.32%

equivalent tool-result capacity increase (up from 19.71%)

Replaying ReclaimLLM 0.1.35 over the organization's latest 50 eligible sessions reduced the text tool-result stream from 13,420,338 tokens to 10,142,010 tokens without re-running historical commands or calling a model. Across 18,510 non-image tool calls, 14,124 tool outputs (76.30%) were actively compacted, with 96.64% of result characters reachable by the transform core.

Every 1 million text tool-result tokens in this workload would require about 755,700 tokens after reduction. Within that portion of context, the remaining budget could carry roughly 323,200 additional tokens of equivalent original tool-output workload.

Capacity calculation

3,278,328 / 10,142,010 = 32.32%

78.09% of all removed tokens (2,560,129 tokens) came from three new Round 2 mechanisms that compact native tool outputs directly.

What “text tool-result tokens” means: When an agent runs a tool (exec, run_command, view_file, replace_file_content, grep_search), the tool's output is returned by the environment and appended to the conversation history as input context for the next LLM turn—and every subsequent turn until compaction. ReclaimLLM reduces those tool outputs at the hook boundary while retaining the exact raw result in session capture.

Round 1 vs. Round 2 progression

From shell-only filters to full tool-output coverage.

In Round 1, savings were concentrated in standalone shell commands (rg, sed, and cd-prefixed commands). Round 2 repaired provider transcript capture for multi-block tool outputs and extended compaction to native file-view wrappers, echoed edit diffs, structured exec streams, and repeated stateful outputs.

MeasureRound 1 (2026-08-09)Round 2 (2026-10-26)Change
Runtime implementation0.1.27 (3 mechanism families)0.1.35 (+4 new tool-output mechanisms)Expanded native tool pipeline
Sessions considered / eligible97 / 61 (62.89%)70 / 50 (71.43%)+8.54 pp eligibility rate
Reachable result-char coverageShell + basic reads96.64%Broad native tool coverage
Original text tool-result tokens4,106,18013,420,3383.27× larger tool-output volume
Text tool-result tokens removed676,0613,278,3284.85× total tokens removed
Text tool-result reduction16.46%24.43%+7.97 pp (+48.4% relative)
Equivalent capacity increase19.71%32.32%+12.61 pp (+64.0% relative)

Where the new savings come from

Every removed token attributed to the mechanism that shaped it.

Four new or expanded Round 2 mechanisms—provider_output_shaping, provider_canonicalization, edit_receipt, and stateful_delta—accounted for 81.73% of all tokens removed (2,679,529 of 3,278,328 tokens).

Meanwhile, expanded H3_exec_compaction (including command-aware filters and read-only SQL row sampling) and range_cache contributed the remaining 598,799 tokens (18.27%).

MechanismRound 2 statusShaped callsOriginal tokens (shaped)Tokens removedShare of savingsReduction on shaped
provider_output_shapingNew in Round 21,0791,828,1021,060,57532.35%58.01%
provider_canonicalizationNew in Round 26,5166,552,866807,14324.62%12.32%
edit_receiptNew in Round 21,634859,463692,41121.12%80.56%
H3_exec_compactionExpanded4,4912,079,049521,59215.91%25.09%
stateful_deltaNew in Round 2229157,185119,4003.64%75.96%
range_cache (H1)Extended12995,72570,0592.14%73.19%
lossless_search_path_foldingShipped in R14042,9455,2140.16%12.14%
legacy_compress / test_filter / hash_dedupeShipped in R164,1801,9340.06%46.27%
Total across shaped callsAll mechanisms14,12411,619,5153,278,328100.00%28.21%

New · 32.35% of savings

provider_output_shaping

1,060,575 tokens removed

Shapes structured native tool outputs—specifically Codex exec streams prefixed with 'Script completed' / 'Chunk ID:' headers and Antigravity grep_search, find_by_name, and list_dir outputs—cutting shaped calls by 58.01%.

New · 24.62% of savings

provider_canonicalization

807,143 tokens removed

Strips volatile capture timestamps ('Created At:' / 'Completed At:') and repetitive line-numbering / truncation wrapper notices injected into every view_file output across 6,516 file reads.

New · 21.12% of savings

edit_receipt

692,411 tokens removed

When replace_file_content, multi_replace_file_content, or write_to_file succeeds, providers echo back the full [diff_block_start] patch the model just wrote. edit_receipt replaces the echoed diff with a compact SHA-256-verifiable receipt (80.56% reduction).

Expanded · 15.91% of savings

H3_exec_compaction

521,592 tokens removed

Command-aware shell and test output compaction across 4,491 run_command and Bash calls (uv, pytest, grep, ls, python3, find, ssh), plus read-only supabase.execute_sql row sampling (>30 rows compacted to 12 head + 6 tail rows).

New · 3.64% of savings

stateful_delta

119,400 tokens removed

Compares repeated shell, search, and listing outputs for the same semantic target against the preceding call in the session. When overlap is ≥60% and size ≥600 chars, it emits only [rclm state delta] with added/removed lines (75.96% reduction).

Extended · 2.14% of savings

range_cache (H1)

70,059 tokens removed

Line-range read caching extended with build_antigravity_view_request to parse 'Showing lines X to Y' headers, replacing unchanged re-reads of previously viewed file ranges with a compact cache-hit reference (73.19% reduction).

Tool-output reduction by tool type

Which tool outputs shrank the most.

Across the 50 eligible sessions, 19,316 total tool calls were captured (18,510 non-image text tool calls and 806 image calls excluded from the text denominator). Four tool families—exec, view_file, replace_file_content, and run_command—generated 98.83% of all removed tokens.

Tool nameTool output roleTotal callsOriginal tokensTokens removedReductionMechanisms applied
execCodex command & script output1,8051,776,5151,031,31358.05%provider_output_shaping, hash_dedupe
view_fileFile range inspection output6,7256,655,416877,20213.18%provider_canonicalization (807,143), range_cache (70,059)
replace_file_contentEchoed file patch diffs1,656860,516692,41180.46%edit_receipt
run_commandShell & test runner output6,4122,778,137639,00023.00%H3_exec_compaction (521,592), stateful_delta, path folding
grep_searchRepository pattern search output555415,36826,5836.40%provider_output_shaping, stateful_delta
find_by_nameFile path discovery output18949,8107,93315.93%provider_output_shaping, stateful_delta
list_dirDirectory listing output6316,8603,88623.05%provider_output_shaping, stateful_delta
Other text toolsMCP calls, metadata, uncovered1,105867,71600.00%Passed through unchanged
All text tool callsNon-image tool outputs (14,124 shaped)18,51013,420,3383,278,32824.43%76.30% of text tool calls actively compacted

Top 10 shell command families inside run_command

Within the 639,000 tokens removed from run_command tool outputs, package/test runners (uv, pytest) and search/inspection commands (grep, ls, python3, find) dominated:

Command familyTokens removedTypical tool-output noise compacted
uv171,413Package resolution, virtual-env sync logs, and test runner wrappers
pytest120,724Passing test dots, fixture setup logs, and repeated assertion tracebacks
grep76,262Unscoped multi-file search output and repeated path prefixes
ls60,119Long directory listings across repeated turns
python354,987One-off diagnostic scripts and data inspection dumps
find37,681Deep directory tree enumerations
ssh34,617Remote deployment and container inspection output
cd19,217cd <dir> && ... compound shell commands
git17,373Status, diff, and log inspection commands
rg9,306Ripgrep search results

Corpus eligibility & provider breakdown

Broad gains across Gemini/Antigravity, Codex, and Claude.

In Round 1, Gemini/Antigravity tool outputs saw only a 2.29% reduction because wrapped view_file, replace_file_content, and run_command envelopes were not yet parsed by native transforms. In Round 2, Gemini/Antigravity reduction rose to 19.87% (2,148,670 tokens removed).

Codex reduction rose from 40.10% to 45.87% (84.74% equivalent capacity increase) after repairing custom_tool_call_output array ingestion, while Claude rose from 9.86% to 27.24%.

Eligibility stageSessions
Considered70
Eligible and replayed50
Excluded20

Of 20 exclusions, 9 lacked ≥5 replay-eligible calls, 9 had incomplete session_state, 1 lacked enough text-result tokens, and 1 exceeded the allowable unresolvable share. Eligible share: 71.43%. Sample confidence: full.

SourceOriginal tokensTokens removedReductionCapacity increase
Gemini / Antigravity10,813,8042,148,67019.87%24.80%
Codex2,248,3991,031,31345.87%84.74%
Claude267,48472,86327.24%37.44%
Unattributed90,65125,48228.11%39.10%
Total13,420,3383,278,32824.43%32.32%

Unresolvable calls dropped to 75 across the entire 50-session corpus (0.42% of eligible calls), with 96.64% of result characters reachable by the transform core.

Standalone stage vs. combined pipeline (replay_compare)

Pipeline stage configurationTokens removedReductionReachable char coverage
shell_compaction stage alone (native tool transforms + edit_receipt + canonicalization + H3_exec)3,175,21023.66%93.85%
stateful_delta stage alone119,4000.89%1.17%
range_cache (H1) stage alone70,0590.52%48.23%
hash_dedupe stage alone1,3380.01%96.66%
Combined 4-stage pipeline (range_cache → stateful_delta → shell_compaction → hash_dedupe)3,278,32824.43%96.64%

Because range_cache and stateful_delta execute before shell_compaction in the combined pipeline, some calls claimed early by caching or delta differencing would otherwise have been partially compacted by shell_compaction; the combined row reports the exact non-overlapping net reduction.

Window sensitivity check

Consistent 20.8%–26.5% reduction across 30-, 45-, and 60-day windows.

To verify that the Round 2 result is not an artifact of scanning a 60-day window to reach 50 eligible sessions, Replay was also executed across 45-day and 30-day rolling windows.

Rolling windowConsideredEligibleOriginal tokensTokens removedReductionCapacity increase
60 days (target 50 eligible)705013,420,3383,278,32824.43%32.32%
45 days734811,835,1473,135,81126.50%36.05%
30 days62429,789,7272,032,80520.76%26.21%

Interpretation

Supported

Across 50 sessions (~13.4M tool-output tokens), ReclaimLLM removed ~3.2M tokens from tool outputs (~24% reduction)—letting the same token budget carry ~32% more coding workload.

Not supported

  • Total organizational model input tokens would fall by 24.43%.
  • The organization would receive 32.32% more completed tasks.
  • Provider bills would fall by the same percentage.
  • Output quality, retry rates, and turn counts would remain unchanged under live enforcement.

Replay never invokes a model. It cannot observe path changes, retries, or turn-count effects, which may make real-world impact lower—or negative. Prompt caching can also change billable tokens without changing the raw tool-output reduction measured here.

Explore the evidence

Measure your own sessions before claiming savings.

Compare this Round 2 analysis with the original Round 1 baseline, explore each context-compression mechanism in detail, or install rclm to run read-only Replay against your own organization's captured sessions.