Lean trims verbose shell output before your coding agent reads it while preserving every error line, intercepts bloated Antigravity file reads, enforces a shared hook + MCP turn budget and audits Turn-1 prefix bloat.
Claude Code · Codex · Antigravity CLI · runs on your machine
Five ways Lean shrinks every turn
T8 · 100 % markers kept
Shell compaction via footnote run
Hooks installed by footnote install --lean wrap builds, tests, linters, git and search commands in Claude Code, Codex and Antigravity CLI (agy / T3 Code). Passes through untouched whenever filtering wouldn't make output smaller; full logs stay local via footnote output <id> (secrets never cached).
Antigravity
Read & re-read guards
Intercepts oversized whole-file reads (≥ 500 lines) on indexed repos with Code Graph outlines, caps unindexed files, blocks unchanged repeat whole-file reads within 20 steps, and guides grep calls toward symbol search.
HOOK-BUDGET · −57.1 %
Unified hook + MCP turn budget
Hard per-event caps (3,400 B start, 1,200 B prompt/tool) plus an HMAC-verified shared shown-log eliminate 100 % of hook ↔ MCP duplicates.
TurnAllocator2,688 B
Prior start6,267 B
MCP-61 · 3,979 B
Turn-1 prefix audit
footnote audit-prefix --probe-mcp measures what MCP schemas, instructions and skills send on every turn. Footnote's 8-tool MCP schema fits in 3,979 B (under the 5,000 B budget).
Usage & Lean B
Handoff, Lean B & offline pricing
Warns past 140,000 tokens (or 55 idle min above 60k) for a clean handoff, toggles memory.lean_rules via a 4-bar picto in Launcher Usage, and prices transcripts locally using a bundled LiteLLM snapshot (usage --sync-prices to refresh).
Shell filter measurements (T8)
13 cases across 6 command families (20 Nov 2026). Pre-registered gate: keep at least 99 % of failure markers, save at least 20 % of bytes, never bloat output. Every family kept 100 % of failure markers (99 of 99).
Command family
Cases
Bytes saved
Failure lines kept
cargo test
3
88.8 %
9 of 9 100 %
cargo build
1
80.6 %
6 of 6 100 %
test runners
2
69.4 %
7 of 7 100 %
linters
2
52.0 %
10 of 10 100 %
git
3
24.7 %
27 of 27 100 %
search
2
22.5 %
40 of 40 100 %
Failure markers cover compiler error codes, failing assertions, panic locations, diff hunks, search line numbers and lint rule codes (5 recordings + 8 live commands on this repository; pre-registered gate, not a broad field study).
Against RTK 1.2.0: same live commands
RTK compresses aggressively on tests and diffs, at the cost of dropping actual failure lines. On rg search it saves nothing. Chart compares failure marker retention rate directly above the raw table.
Failure-marker retention vs bytes saved
Footnote kept (%)RTK 1.2.0 kept (%)
cargo test failure markerssaved: 88.0 % Footnote vs 96.9 % RTK
In our 7-arm claude-haiku-5-5 single-turn evaluation (126 calls, 25 Nov 2026, LEAN-B), lean_b_lite delivered the lowest cost per accepted answer while keeping 6/6 durable-prose compliance. Paired 95% confidence intervals vs Control crossed zero, so concise output rules remain opt-in (memory.lean_rules = false by default).
Arm (claude-haiku-5-5)
Cost / accepted
Durable-prose exclusion
Note
lean_b_lite
$0.000803
6 / 6 (100 %)
−237.4 output tokens [−442.2, −32.6] vs Control
Control (off)
$0.000867
6 / 6 (100 %)
Default baseline (memory.lean_rules = false)
Ponytail
$0.000871
—
External terse prompt arm
Caveman
$0.001058
—
50.0 % task acceptance rate
Live monthly quota savings across multi-turn, multi-model sessions remain unmeasured (HOOK-BUDGET and LEAN-C1 measure deterministic replay/paired suites; T1 Opus pilot measured 20–34 % fewer output tokens at small sample size).
Prefix sizes across diverse real user setups vary—measure yours directly with footnote audit-prefix --probe-mcp.