Purpose lcc (Local Context Compiler) solves the problem of context bloat in long coding-agent sessions. Its approach is the opposite of Claude Code's /compact: /compact replaces the entire session with a model-generated summary, and summaries often lose the exact error messages, paths, or line numbers that the agent needs two turns later; lcc merely moves old tool outputs out of the context, every user and assistant message is still preserved as-is, and removed content can be retrieved at any time with recall.
Key capabilities Verbatim: preserved fragments are byte-identical to the source files, with no summarization or rewriting. Recoverable: stash moves removed outputs into a local content-addressed store (~/.cache/lcc/stash), and recall re-hashes and verifies them on read. Placeholders look like [removed: 120 lines, 4.3 KB · lcc recall <id>], reporting line count and size rather than token count, so they are consistent on any machine. Auditable: every run writes out a JSON report, and lcc explain gives the reason each item was removed. Local: the default decision rules run in pure Python on the CPU, require no API key, and make no network connections.
Usage The PyPI package name is local-context-compiler, and the install command is pip install local-context-compiler; the official documentation specifically warns that pip install lcc will install an unrelated astronomy package of the same name. fetch-tokenizer downloads tiktoken's encoding files once and is the only lcc command that makes a network connection; without it, counts are marked as approximate. The command-line tool can operate directly on session files or any document; when run without arguments, it reads the most recent Claude Code session, runs rules mode offline, and within seconds prints only counts, without modifying anything or sending anything off the local machine. The MCP server supports Claude Code, Cursor, Claude Desktop, and any stdio client, and provides tools including compact, compact_transcript, recall, inspect, prepare, explain, intake. The Claude Code plugin is used to replace /compact summaries; because function hooks are in early access, it requires Claude Code 2.1.274+ and the corresponding flag, and mcp__plugin_lcc_lcc__recall must be allowed so that the agent can retrieve removed output. When a processing run fails or too little content is removed, the plugin falls back to the built-in summary and shows a toast notification. measure-session can be used to measure the effect; the official release also provides lcc share-stats, which aggregates local reports into a count-only summary.
Effect data (from the official description) On the main branch (whose stash annotations indicate line counts and sizes), the same session measured 28,983 (−49.2%), which the official description calls one of the best cases. Across all 299 long sessions of the maintainer (each with more than 100 messages, 36.3 M tokens in total), the median reduction was 21.8% (middle half range 15% to 31%, best 65%), with 0 messages lost (python benchmarks/research/long_sessions.py, 2026-10-23, main). In a preregistered test on 172 real requests, agents using stash context plus recall performed comparably to those using full context on file recall (+0.006, 95% CI −0.023 to +0.034) while using 36.6% fewer tokens; for questions involving removed content, recall was invoked 90% of the time. For /compact-style summaries of the same sessions (officially reimplemented with Opus), exact-value accuracy was 73%, compared with 98% for full verbatim context. In a synthetic reproducible benchmark (python benchmarks/run_judge_bench.py, about 20 seconds, no network), nine handwritten boundary cases cover supersession, contradiction, config change, exception rule, pt/en mixed, prompt injection in tool output, large git diff, old root cause, re-read. The official documentation notes that these use cases are lexically simple, the lexical baseline performs well, and specialist-v3 missed the Portuguese use case; timings come from macOS arm64 under high load. The held-out test on real sessions (INFERIDO) is based on 193 entries from 36 sessions that began after the training cutoff, and reports Retention AUC under a 0–60% candidate token discard budget; labels come from next-action evidence from one maintainer's Claude Code sessions, which biases toward v3's training objective, the sessions are private, and only aggregate results are published.
Applicable scenarios Suitable for long-running coding agent sessions, especially those that need to repeatedly reference precise information such as error messages, paths, and line numbers from earlier tool output; also suitable for teams that want to compress context locally, offline, and auditably. Because removed output can be restored, it strikes a balance between preserving evidence and saving tokens.
Limitations and caveats The reduction magnitude depends on how much noise is in the context; if the gain is below 25%, the report marks this run as not worthwhile, and the Claude Code plugin keeps the built-in summary. lcc does not check whether the model can answer correctly; a structural PASS does not represent an answer-quality result. It does not include RAG, embeddings, or a vector store. Protection rules and bounded recovery can only reduce, not eliminate, the risk of evidence loss. specialist-v3 was trained on Claude Code transcripts; other agents and ordinary documents are out of distribution; plain text under auto uses mechanical mode unless Jev is explicitly selected. Jev is an optional path that must be explicitly specified via --provider jev; it sends the target and context blocks to the TypeSafe API, and LCC_DISABLE_NETWORK=1 can disable it; auto will not choose Jev on its own, and even configuring a key does not count as consent to send context externally; plain text under auto still uses mechanical unless LCC_AUTO_REMOTE=1 is set. compact writes a relevance-compaction-1.2 report; before use, check the provider_used and degraded fields. The project is under the MIT license, and the optional Laya integration carries an Apache-2.0 attribution; maintained by LookADev, with contribution, security, and change notes in CONTRIBUTING.md, SECURITY.md, and CHANGELOG.md respectively.