Skip to content

thanatos9404/llmslim

v0.11.2MIT

Long-term memory with no LLM in the loop: a local MCP server stores messages word for word in SQLite and recalls the ones that answer a question within a token budget.

LLMSlim plugin for Claude Code

This plugin gives Claude Code long-term memory that persists across sessions, with no LLM in the loop. It runs the LLMSlim MCP server, which stores messages word for word in a local SQLite file and, when asked, returns the stored messages that answer a question within a token budget. Nothing is summarized or rewritten on the way in or out.

It also adds two commands for llmslim wrap claude, which runs Claude Code through a local proxy that shortens long shell, search and web tool output in the requests it sends to Anthropic's API.

What it adds

The llmslim MCP server, started with:

uvx --from "llmslim[mcp]==0.11.2" llmslim mcp
ToolWhat it doesChanges data
rememberStores a message word for word and returns its id.Adds
recallReturns the stored messages that answer a question, under their dates and whole where they fit, within a token budget.No
list_memoriesLists recent messages with their ids, newest first.No
forgetDeletes one message. It can't be undone.Deletes
fit_contextShrinks a long text to a token budget, keeping what answers a query, in order.No

Two commands for the proxy. Neither one starts it.

  • /llmslim:wrap-claude checks whether the proxy is installed (llmslim proxy --help) and explains how to restart Claude Code through it with llmslim wrap claude.
  • /llmslim:savings runs llmslim proxy stats and reports how many input tokens the proxy kept out of Claude Code's requests. It is an estimate counted before prompt-cache discounts, not dollars saved.

Install

/plugin marketplace add Thanatos9404/llmslim
/plugin install llmslim@llmslim

On Claude Code 2.1.275 or later, /plugin install llmslim --marketplace Thanatos9404/llmslim does both in one step.

Requirements

  • uv, which provides uvx. The plugin starts the memory server with it.
  • Python 3.10 or newer for the memory server. If you don't have one, uv python install adds one.
  • For the two proxy commands, the proxy installed once with uv tool install "llmslim[proxy]" or pip install "llmslim[proxy]" (Python 3.9 or newer).

Data and network

  • Memory stays on your machine. It is a SQLite file at ~/.llmslim/memory.db. Set LLMSLIM_MEMORY_DB to use another file.
  • No model call. Storing and recalling are plain code: no LLM, no embedding API and no API key.
  • The memory server makes no network calls of its own. Three things do reach the network:
    • uvx downloads llmslim and its dependencies from PyPI the first time it runs a version.
    • The tiktoken library downloads its tokenizer file (cl100k_base) from openaipublic.blob.core.windows.net the first time it counts tokens, and caches it. No memory content is sent. Without network access, LLMSlim falls back to an approximate count.
    • The proxy, if you choose to run it with llmslim wrap claude, listens on 127.0.0.1 and forwards Claude Code's requests, with your credentials, to Anthropic's API (or to $ANTHROPIC_BASE_URL). It stores tool output in ~/.llmslim/proxy.db. The plugin's commands don't start it.
  • The scope is fixed when the server starts, not chosen by the model, so injected text can't make it read or delete another user's memory. Recalled text is labelled as data, not instructions.

More

License

MIT. See LICENSE.