lcc 1.2.0 · open source · MIT
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. It runs on your machine, with no API key and no network.
/compact vs lcc
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 keeps every message and moves old tool outputs to a local stash, one recall away.
| /compact | lcc (rules, stashed) | |
|---|---|---|
| Your messages | Rewritten into one summary | Every user and assistant message kept byte for byte |
| Old tool outputs | Gone | Moved to a local stash, one recall away, hash-checked |
| Exact errors, paths, values | Often lost | Recoverable verbatim |
| How it decides | A model writes the summary | Deterministic rules on your CPU |
| Audit trail | None | A JSON report per pass; lcc explain gives the reason for every drop |
Measured, not promised
These are the maintainer's own sessions, measured offline with exact o200k_base token counts.
- 22.7%
- median token cut across all 266 long Claude Code sessions (100+ messages each); middle half 15% to 32%, best 65%
- 0
- messages lost in any of those sessions
- 172
- requests in a pre-registered test: stashed context plus recall matched full context on file recall
- 73% vs 98%
- exact values right: a /compact-style summary vs full, verbatim context
Install
pip install "local-context-compiler[tiktoken]"export CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1claude plugin marketplace add lucasmartins-ai/lccclaude plugin install lcc@lcc --config provider=rules --config rulesMode=stashed
Function hooks are early access, so the plugin needs Claude Code 2.1.274+ and the flag above. Allow mcp__plugin_lcc_lcc__recall so the agent can get removed outputs back. If a pass fails or removes too little, the plugin hands over to the built-in summary and tells you.
Run it on one of your sessions
measure-session runs every mode offline and prints counts only: messages, tool calls, tokens before and after, messages kept. No text, path or tool output leaves your machine.
lcc measure-session <session>.jsonl --markdown