Compacting Claude Code at 400K instead of 967K cut this dev's cost per request by 43%
Awkward-Let-4628 · reddit · 2026-11-03
The author set autoCompactWindow: 400000 on 1M-window models, where Claude Code otherwise compacts near 967K. Comparing 25K requests before and 16K after, average context per request fell from 415K to 220K and cost per request dropped 43% (previously 68% of main-thread cost came from >400K requests). The tradeoff: more compactions—75 summaries in one week, 95 minutes of waiting. His fix is "sliding instead of summarizing": a hook keeps the conversation verbatim and replaces old tool outputs with a one-liner, taking milliseconds with no model call. Benchmarks show −19% to −35% cost and −17% to −33% time vs Claude Code summaries, all tests passing. He also released tokendoctor (free, local, MIT), which replays your sessions at 200K–600K windows to compute your personal savings before changing anything.
More from coding & agent
- MIT-licensed frontend skill gives coding agents a 7-step design and verification workflow — Extra-Highlight9183 · 2026-11-03
- Trajectory launches post-training platform with GS1 and Continual Graders research previews — simonguozirui · 2026-11-03
- SMBs are rebuilding their entire GTM stack with agent-native tools, says new thread — garrytan · 2026-11-03
- Capy 0.7.0 ships Captains orchestration GA; YC's Garry Tan reports 5X issue-fixing throughput — garrytan · 2026-11-03
- OpenAI builds Pando, a new Git backend that cut push latency ~80% serving ~1PB daily — OpenAIDevs · 2026-11-03
- How Uber built MCP Gateway, its centralized platform for agent-tool access — adnan_hashmi · 2026-11-03