Show HN: Lcc – compact Claude Code sessions without summarizing them A tool called lcc, published to PyPI as version 1.2.0 by developer lucasmartins-ai, compacts Claude Code sessions by removing old tool outputs while keeping every user and assistant message byte for byte, rather than replacing the session with a model-written summary as Claude Code's built-in `/compact` does. On one 193-message session with 75 tool calls, lcc cut tokens from 57,083 to 28,807 (−49.5%) while preserving all 43 user and assistant messages and stashing 33 removed tool outputs for retrieval via a `recall` command; across 299 long sessions (100+ messages each, 36.3M tokens) the median cut was 21.8% with 0 messages lost. In a pre-registered test on 172 real requests, an agent answering from the stashed context plus `recall` matched full-context performance on file recall (+0.006, 95% CI −0.023 to +0.034) with 36.6% fewer tokens, calling `recall` for 90% of questions about removed content, while a `/compact`-style summary of the same sessions got 73% of exact values right versus 98% for full verbatim context. Compact coding-agent context without summarizing it away. lcc cuts what the model does not need, keeps everything else byte for byte, and writes a receipt. Claude Code's /compact replaces your session with a summary written by a model. Summaries drop the exact error, path or line the agent needs two turns later. lcc does the opposite: old tool outputs leave the context but stay one recall away, and every user and assistant message is kept as it was. | One real Claude Code session 193 messages, 75 tool calls | tokens | user and assistant messages | removed tool outputs | |---|---|---|---| | before | 57,083 | 43, as written | — | | /compact | one summary | rewritten into the summary | gone | | lcc rules , stashed | 28,807 −49.5% | 43 / 43 byte for byte | 33, each one recall away | Measured with lcc measure-session PyPI 1.2.0, offline, exact o200k base token count; re-run 2026-10-23 . On main , whose stash note now states lines and size, the same session gives 28,983 −49.2% . That session is one of the best cases. Across all 299 of my long sessions 100+ messages each, 36.3 M tokens the median cut was 21.8% middle half 15% to 31%, best 65% , with 0 messages lost python benchmarks/research/long sessions.py , 2026-10-23, main . These are all my sessions: run it on yours send-us-your-numbers and post the result. In a pre-registered test on 172 real requests evidence https://github.com/lucasmartins-ai/lcc/blob/main/docs/EVIDENCE.md , an agent answering from the stashed context plus recall did as well as with the full context on file recall +0.006, 95% CI −0.023 to +0.034 with 36.6% fewer tokens. It called recall for 90% of the questions about removed content. A /compact -style summary of the same sessions got 73% of exact values right our reimplementation of /compact , written by Opus ; full and verbatim context got 98%. pip install "local-context-compiler tiktoken " the CLI is lcc lcc measure-session "$ ls -t ~/.claude/projects/ / .jsonl | head -1 " your latest session The second line reads your most recent Claude Code session, runs every mode offline and prints counts only. Nothing is changed and nothing leaves the machine. Claude Code plugin replaces the /compact summary . Function hooks are early access, so this needs Claude Code 2.1.274+ and the flag below : export CLAUDE CODE ENABLE FUNCTION HOOKS=1 claude plugin marketplace add lucasmartins-ai/lcc claude plugin install lcc@lcc --config provider=rules --config rulesMode=stashed Allow mcp plugin lcc lcc recall so the agent can get removed outputs back. When a pass fails or removes too little, the plugin hands over to the built-in summary and says so in a toast. Details: Claude Code guide https://github.com/lucasmartins-ai/lcc/blob/main/docs/CLAUDE CODE.md . MCP Claude Code, Cursor, Claude Desktop, any stdio client : {"mcpServers": {"lcc": {"command": "lcc", "args": "mcp" }}} Tools: compact , compact transcript , recall , inspect , prepare , explain , intake MCP guide https://github.com/lucasmartins-ai/lcc/blob/main/docs/MCP.md . CLI , on a session file or any document: lcc compact ~/.claude/projects/