lcc on the Claude Code marketplace)lcc ships a Claude Code plugin that replaces the built-in compaction summary with
verbatim compaction: the session transcript goes to the plugin’s own lcc mcp server, Jev
says which tool calls and results are spent, and those pairs are dropped. Kept messages carry
their original bytes; user and assistant text is never scored, trimmed or rewritten. The
decision logic, the report schema and the fallback rules are the ones documented in
docs/TOOL_CALLS.md for lcc compact --mode tool-calls.
export CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 # required while function hooks are early access
export TYPESAFE_API_KEY=... # only for the default Jev judge
# or ~/.config/lcc/typesafe.key, or the keychain
pip install "local-context-compiler[tiktoken]" # the `lcc` CLI and its MCP server
claude plugin marketplace add lucasmartins-ai/lcc
claude plugin install lcc@lcc
Requirements: Claude Code 2.1.274 or newer and lcc on PATH. A TypeSafe API key is
needed only for the default Jev judge; set provider: laya in the plugin config to run
locally with no key and no network.
Against a checkout, without installing:
CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 claude --plugin-dir plugins/claude-code
| Path | What it is |
|---|---|
.claude-plugin/marketplace.json |
the marketplace this repository hosts (name lcc) |
plugins/claude-code/.claude-plugin/plugin.json |
the plugin manifest and its configurable options |
plugins/claude-code/.mcp.json |
starts the plugin’s own lcc mcp server |
plugins/claude-code/hooks/hooks.json |
registers the hook module |
plugins/claude-code/hooks/lcc-compact.mjs |
the adapter: session.compact → compact_transcript → messages |
plugins/claude-code/hooks/map.mjs |
the pure mapping helpers, unit-tested on their own |
plugins/claude-code/hooks/README.md |
operator guide: what runs, what falls back, what is limited |
The hook is plain ESM with no build step and no dependencies: the Python package does the work, the plugin translates.
Set through /plugin → lcc, or claude plugin install lcc@lcc --config key=value
(defaults in parentheses):
| Option | Meaning |
|---|---|
question ("") |
the objective; empty uses the text after /compact, or the newest user prompts |
threshold (0.5) |
below this keep-probability a call or result becomes a candidate for removal |
preserveRecentMessages (6) |
newest messages never scored, never mutated |
trimHeadChars (300) |
characters kept from a spent result whose call still matters |
maxStateTokens (25000) |
token ceiling for the conversation shown to the judge |
maxRequestTokens (30000) |
ceiling for state plus one batch of questions per request |
minReductionRatio (0.25) |
below this share removed, the plugin keeps the built-in summary |
server (lcc) |
MCP server name to call |
No key, a degraded pass, a conversation that cannot fit the state budget, a pass below
minReductionRatio, content the hook cannot rebuild (image or attachment blocks), or any MCP
failure — each of those calls next(event), so Claude Code compacts exactly as it did before.
The plugin also never requests a compaction of its own; it only decides what a compaction
produces. Every outcome is one log line plus one toast, e.g.:
lcc: verbatim compaction, no summary (kept 18 messages, dropped 7 tool call(s), trimmed 2)
lcc: built-in summary (below the 25% minimum (4.2%))
lcc: built-in summary (judge unavailable (jev_unavailable_fail_safe))
Verified: claude plugin validate plugins/claude-code passes and reports the registered
surface (session.compact; calls $.mcp.call, $.ui.log, $.ui.toast); the plugin installs
from this repository’s marketplace with the documented commands (`claude plugin marketplace add