Added
full-compactread mode.
Newctx_readmode: headerless, trailing-whitespace-stripped verbatim
content. Used by the Read redirect to produce temp files faithful to the
original line structure while giving ~5–10 % compression without breaking
the host'soffset/limitwindowed reads (fixes header-in-temp-file offset
bug from the originalfullmode, #1021 follow-up).- Dashboard channel-breakdown API.
New/api/statsfieldchannel_breakdownclassifies every recorded command
intoredirect(hook-intercepted native tools),rewrite(shell commands
rewritten to lean-ctx), ormcp(direct ctx_* calls). Powers the Cockpit
Proof/Trends chart showing which delivery channel contributes what savings.
Changed
- Default
memory_cleanupswitched fromaggressivetoshared.
Idle cache TTL rises from 5 minutes to 1 hour, matching real-world agent
session durations (think pauses, context switches). Low-memory devices can
opt back viamemory_cleanup = "aggressive"orLEAN_CTX_MEMORY_CLEANUP=aggressive. - Default
cache_max_tokensraised from 500k to 2M.
Four times more headroom for the in-memory read cache — eliminates premature
eviction in large codebases. Override viaLEAN_CTX_CACHE_MAX_TOKENS. - Read redirect switched from
fulltofull-compactmode.
Redirect hook now produces headerless, whitespace-trimmed temp files. Fixes
offset/limit correctness (#1021 follow-up) and saves ~5–10 % on every
redirected native Read. - Grep redirect now host-aware (GH #398 follow-up).
grep_content_mode()no longer requires an explicitoutput_mode=content
parameter — when the mode is absent, it detects the host IDE and allows the
redirect on Cursor (which defaults tocontent) while blocking it on Claude
Code (which defaults tofiles_with_matches). - Rules enforcement strengthened across all IDEs (RULES_VERSION 8 → 9, CLAUDE.md v6 → v7).
All 28 supported IDEs now receive MUST/NEVER/SELF-CORRECT language with
quantitative evidence (~1 % hook redirect vs 13–70 % direct ctx_* savings),
replacing the previous "prefer" wording that let agents fall back to native
tools silently.
Fixed
- Compressed-output cache hits now properly counted.
SessionCache::get_compressed()incrementscache_hitsandtotal_reads,
so re-reads of auto/map/signatures outputs appear in CEP stats and dashboard. read_dedupsavings tracked in CEP stats.
The PostToolUseread_deduphook now callsstats::record("cli_read_dedup")stats::flush(), surfacing dedup savings in the redirect channel on the
dashboard.
- Dashboard channel-breakdown empty state.
cockpit-remaining.jsnow shows a helpful "No channel data yet" message
instead of silently rendering nothing (which previously caused a
SyntaxErroron the Proof/Trends page). cap_to_raw()inflation prevention tracked as metric.
Events where framed output would exceed raw content are now counted in
cache_telemetryand shown inctx_cache status.- CLI
lstree-tracking fix.
cmd_lsnow passes the realoriginaltoken count tocli_track_tree
instead of0, so tree-view savings appear correctly in CEP stats. - agent_wrapper:
pwd -and unquoted eval arg (GH #745 follow-up).
Two additional Claude Code sandbox variants now handled: (1) trailing
pwd -(lone dash flag) not matched byhas_trailing_bare_pwd; (2) unquoted
eval arguments (eval pwdvseval 'pwd'). - Doctor text corrected: shared cleanup description updated from
"30 min" to "1 hour" to match the new default TTL.