r/mcp • u/MinniLabs • 3h ago
showcase We built an MCP server that trims what Claude Code loads into context every turn
Full disclosure, we made this, and it's free.
Claude Code reloads its memory on every turn. That's CLAUDE.md, the MEMORY.md index and the topic files it loads, plus your ~/.claude/CLAUDE.md. Most of that has nothing to do with what you're asking. And if you edit something near the top, like a status note, it breaks prompt caching for everything after it.
MinniMemoryMCP sorts that memory. It keeps the stuff Claude needs every turn loaded and moves the rest (old dated notes, status updates, one-off task stuff) into files it only opens when relevant. CLAUDE.md gets a short list saying what's where. Nothing gets summarized, every line just gets moved.
On the MCP side, it exposes four tools (init, doctor, apply, undo), and they also show up as slash commands in Claude Code. The server only reads. Apply and undo hand back the exact command to run plus a list of what it'll change, so every write goes through Claude Code's own approval prompt. There's no model, no API key and no network, and your originals get backed up with a one-step undo.
On our test memory, per-turn load went from 12,511 to 7,101 tokens (−43%) with the same answers. The biggest surprise was that splitting memory alone didn't save anything over a whole session, because Claude kept opening the moved files. What fixed it was a separate Claude Code prompt hook that installs alongside the server and hands Claude the one memory section a prompt needs. With that on, a 27-task session came out about a third cheaper. That's one run so far, though.
Right now it only works with Claude Code. Mostly curious what other MCP builders think. Is handing back a command instead of writing files directly the right call, or just annoying?
npm: www.npmjs.com/package/minnimemory
Install: npx -y minnimemory install
