Claude Modsunofficial directory

Context & memory·terminal · desktop·MIT

SuperLcm

One local archive for Claude Code and Codex chats, with summaries ready before compaction.

SuperLcm takeover beside Claude Code's own compaction, both at 25K of a 300K threshold, Haiku summarizing in the background
Images from the SuperLcm repository, MIT license

SuperLcm keeps your conversations from Claude Code, Codex, Hermes, Pi and dsh harness in one archive on your computer: every original record word for word, plus layered summaries that point back to it. All five tools read the same archive, so a task started in one can continue in another. In Claude Code, the plugin’s mod can also take over compaction: summaries are written in the background after each turn and swapped in at the threshold, so the session does not stop to summarize.

What it does

  • Archive. Hooks save each turn as it happens: your messages, Claude’s replies and its tool calls, each as a numbered record that can be cited and read back later.
  • Layered summaries. Each run of about 12,000 characters (adjustable) becomes a short summary, and neighboring summaries merge into higher layers. The top layer reads like a table of contents, and every entry carries the record numbers it came from.
  • Lookup tools. Claude gets lcm_find, lcm_outline, lcm_read and lcm_continue as MCP tools to search summaries and originals, open the tree one level at a time and read exact records. After a compaction, Claude is told where the full record lives.
  • Continue in another tool. When you hit a usage limit or want a second model, tell the other tool Continue #6e94e via SuperLcm, where #6e94e is the conversation’s code. lcm_continue hands over the top-level outline and the latest messages, and older detail stays one lcm_read away. It works in any direction, and the continued work is archived too.
  • Compaction takeover, Claude Code only. At Claude Code’s threshold, 300K tokens by default (200K, 500K, 800K or a custom size up to 950K), SuperLcm replaces the older messages with the fewest summaries that cover them and keeps the newest 40K tokens (20K, 80K or a custom size) word for word. No model is called at that moment, so the swap takes milliseconds. In the author’s example, a 300K context of about 12,000 records came back at roughly 70K, most of it Claude Code’s own system prompt and tool definitions.

SuperLcm summary tree: one L2 summary over three L1 summaries, each covering a range of original records kept in full

lcm takes a similar lossless approach inside Claude Code alone. SuperLcm’s difference is one archive shared with Codex, Hermes, Pi and dsh harness, and handing a task from one tool to another.

Install

Needs Claude Code 2.1.287 or later, plus Node.js 22.16 or newer on PATH.

claude plugin marketplace add yu381792/superlcm
claude plugin install superlcm@superlcm

Run /superlcm:console to open the local console: settings, your stored conversations, and the connections to Codex, Hermes, Pi and dsh harness. The takeover is off until you turn it on under Settings › Compaction, and turning it off again restores your previous compaction setting. If you connected Claude Code from the console before installing the plugin, its Claude card offers to remove the older hooks and superlcm MCP entry, with a backup first.

How it works

The plugin has two halves. Classic command hooks (SessionStart, UserPromptSubmit, Stop, PostCompact, SessionEnd) run node src/launch.js hook to capture each turn, and an MCP server provides the lookup tools. Both work on Claude Code versions without mods. The mod, compact-mod.js, adds only the background summaries and the takeover. According to the author, it runs in the terminal and in the Code tab of Claude Desktop.

  • session.start passes the main session’s id to the local SuperLcm CLI (summary-host).
  • turn.complete starts a background run, one per session at a time, that asks the CLI for waiting summary pieces and writes each with model.complete on the session’s own login. The turn does not wait for it. Subagents are skipped.
  • session.compact sends the messages being compacted (text cut to 2,000 characters each), any compaction instructions and the context usage to the CLI, which plans the swap. If the takeover is on and the summaries cover the older part, the module returns a summary packet followed by the newest messages untouched. If the takeover is off, the summaries lag behind, anything fails or the session is a subagent, Claude Code compacts the usual way.
  • session.end hands what is left to a separate claude -p worker, which also takes over after a failed model call.

process.run only starts node <plugin>/src/launch.js with one of five commands (summary-host, summary-claim, summary-save, summary-handoff, compact-packet) and a 60-second timeout. When to compact is still Claude Code’s own threshold, which the console sets; the module never starts a compaction itself.

Storage and network. The archive keeps your prompts, Claude’s replies and its tool calls in full, on your computer; the README does not give its path. Tools connected from the console point at a fixed entry file, ~/.superlcm-claude/superlcm.js, that follows plugin updates. The author marks the four lookup tools as read-only, the two summary tools as writing only SuperLcm’s own summaries, and none as reaching outside your computer. Conversation text leaves the machine only for the summary writer you pick.

Tokens. Writing summaries costs tokens; the swap itself does not. You choose the writer per tool in the console:

  • The agent itself (the default): Claude writes each part right after it happens, through lcm_summary_task and lcm_summary_submit, on your main model. The author says this costs almost nothing.
  • Own tool, in the background: in Claude Code with the plugin, this is the mod’s model.complete path. Each call summarizes one segment or merges summaries, with the answer capped at 2,048 tokens, on the model set on the console’s Claude Code card. The author suggests haiku; with no model set, the module uses the session’s current model. Leftovers go to the claude -p worker on the same account.
  • Your own API: any Anthropic or OpenAI-compatible endpoint, including a gateway on your own computer.
  • Off: everything is still saved and searchable.

The author gives no token total per session.

Limitations

  • The takeover covers the main Claude Code conversation and dsh harness. Subagents always compact the usual way, and Codex, Hermes and Pi get the archive and continuation without a takeover for now.
  • Runs wherever Claude can start local programs, such as Claude Code and Cowork on your own computer. Not in claude.ai on the web or in the mobile chat.
  • The module’s events and methods can change between Claude Code versions.

Similar Claude Mods

The whole directory →