Feature

Reduce coding-agent
context waste.

RCLM reduces repeated reads, oversized searches, noisy command output, and duplicate tool results near the source—then measures the effect before calling it savings.

Where it goes

Most of the cost in a long session isn't any one call. It's the resend.

⌕

Unscoped searches

Broad repository searches can return thousands of lines that remain in context while the agent plans, edits, tests, and retries.

↺

Repeated reads

The same unchanged file can be read in full multiple times even though a short notice or diff would preserve the useful information.

▤

Noisy exec output

Test runs, installs, and shell commands can add progress output, repeated lines, and passing-case noise that the model does not need.

↻

Retry loops

Repeated calls and failed edits against the same stale state can spend more turns without moving the task forward.

The earlier unnecessary content enters a long session, the more later turns can carry it forward. Position in the session can matter as much as the original payload size.

Bounded case study

Replay removed 676,061 of 4,106,180 text tool-result tokens.

The current case study replayed 61 eligible sessions out of 97 considered from a rolling 15-day workload at an anonymized two-user software organization. It used a real tokenizer and the shipped range-cache, shell-compaction, and hash-deduplication implementation without calling a model or re-running historical commands.

Original stream

4,106,180

text tool-result tokens

Tokens removed

676,061

counterfactual Replay result

Stream reduction

16.46%

of eligible text tool results

Equivalent capacity

19.71%

within that tool-result budget

Validated from the published counts: 676,061 ÷ 4,106,180 = 16.4645%, which rounds to 16.46%. The reduced stream is 3,430,119 tokens; 676,061 ÷ 3,430,119 = 19.7095%, which rounds to 19.71% equivalent capacity.

This is a shadow-mode counterfactual for eligible text tool results—not realized production savings, total model-input reduction, task throughput, or a provider-bill forecast. The case study reports that one user generated 99.99% of the captured workload.

Review the full methodology and limitations →

Mechanisms

Reduce waste near the tool layer, then measure the whole workflow.

Replay-evaluated

Range-aware read cache

A re-read of a file already seen this session becomes a short notice or a diff, not the full content again.

Included in the 61-session case study; the published result is combined across mechanisms, not attributed to read caching alone

Read mechanism docs ↗

Part of shell replay

Search-result shaping

Broad searches return file names and match counts first, with full matching content available only when the agent actually needs it.

Search shaping ran through the shipped shell-compaction core used by Replay

Read mechanism docs ↗

Measured · lossless

Lossless search and path folding

Repeated file and directory prefixes are folded out of search results and path listings without dropping result rows.

The compact result is expanded and checked against the original before a fold is accepted; ambiguous shapes pass through unchanged

Read mechanism docs ↗

Replay-evaluated

Exec-output compaction

ANSI is stripped, repeated lines are collapsed, and long shell output is reduced to the useful head and tail.

Shell compaction was one of three mechanism families evaluated in the case study

Read mechanism docs ↗

Replay-evaluated

Hash deduplication

Repeated large tool results are replaced with a reference to the earlier equivalent result instead of being carried forward again.

Hash deduplication was one of three mechanism families evaluated in the case study

Read mechanism docs ↗

Command-aware filtering

Test-output filtering

Recognized test runners keep failures and useful summaries while removing repetitive passing-test output.

Command-specific filters are part of the shipped shell-compaction path; no standalone percentage is claimed

Read mechanism docs ↗

Safety control

Loop breaker

Repeated identical calls or failures on the same file are flagged before they consume another turn.

Its impact is estimated from an avoided attempt rather than measured from a replacement tool result

Read mechanism docs ↗

Measured separately

Image downscaling

Oversized images in tool results are reduced before they consume avoidable visual context where the client hook supports it.

Not included in the 61-session Replay result; enforcement and measurement support differ by client

Read mechanism docs ↗

Estimated only

Stale-image eviction opportunity

When a newer screenshot supersedes an older one for the same page and viewport, RCLM estimates the context that could be released.

Measurement-only today: it models the opportunity and possible cache-write cost but never removes the older image

Read mechanism docs ↗

Cohort estimate only

Brevity guidance

An optional Claude Code session-start instruction asks the model to avoid unnecessary preamble, summaries, and formatting.

There is no per-session counterfactual, so brevity is kept out of measured Replay savings

Read mechanism docs ↗

MCP context tool

MCP context tools

file_brief distills prior sessions that touched a file, while handoff packages current session state for a clean continuation.

These complement hook-level compression but are not part of the published 16.46% Replay denominator

Read mechanism docs ↗

Session-start context

Session-start context packs

New Claude Code sessions can begin with compact prior decisions, changed files, and outstanding work from the same project.

Reduces cold-start reconstruction but is kept separate from Replay and measured hook-reduction claims

Read mechanism docs ↗

Rollout

A smaller tool-result stream is evidence—not the final outcome.

01

Measure

Preserve the usage source and calculation method so provider-reported, estimated, and unavailable cost data stay distinct.

02

Observe

Use shadow mode to record what supported mechanisms would remove without changing the agent's visible tool results.

03

Configure

Range caching, loop detection, and text compression default on for fresh installs; dedupe, image lifecycle, brevity, and shadow mode remain opt-in.

04

Verify

Compare billable token classes, turns, retries, failures, task completion, and output quality—not only the text removed.

A mechanism that removes context can still make the workflow worse if it causes more turns, retries, failures, or missing information. Measure first, enable selectively, and keep actual, estimated, and unavailable cost data distinguishable.

Measure your reducible share before claiming savings.

Replay the shipped mechanisms against captured sessions, then verify any enforced rollout against total tokens, retries, task completion, and output quality.