I built an MCP server that gives AI coding assistants persistent memory (85.6% token reduction)

작성자

카테고리:

← 피드로
DEV Community · Kavish Dua · 2026-06-13 개발(SW)

Kavish Dua

Every time you start a new Claude Code session, your AI has zero context about what you were working on. Same with Cursor, Cline, Windsurf. You spend the first few minutes re-explaining the codebase, the decisions you made, where you left off. It’s annoying.

I got tired of it and built something to fix it.

What it does

sessionmem is a local-first MCP server that watches your coding sessions and auto-injects a compact summary at the start of each new one. Your AI instantly knows what you were working on, what decisions were made, and what’s next.

The compression is aggressive. Instead of feeding the full conversation history into context (expensive, often impossible due to token limits), sessionmem distills sessions down to just the key facts. In testing we’re seeing 85.6% token reduction compared to keeping full history.

Everything is stored in SQLite at ~/.sessionmem/memories.db. No cloud, no account, no API keys, no config files to mess with.

Works with everything MCP-compatible

  • Claude Code
  • Cursor
  • Cline
  • Windsurf
  • Any other MCP host

Getting started

Install in 30 seconds:

npx sessionmem

Enter fullscreen mode Exit fullscreen mode

Then add to your MCP config:

{
  "mcpServers": {
    "sessionmem": {
      "command": "npx",
      "args": ["-y", "sessionmem"]
    }
  }
}

Enter fullscreen mode Exit fullscreen mode

That’s it. sessionmem starts watching your sessions immediately and builds up memory over time.

Why local-first

Your code is sensitive. Your thought process, architecture decisions, and in-progress work shouldn’t be sent to a third-party service.

SQLite is fast and zero-dependency. Works offline, no daemon to manage, no Docker.

You own your data. The database file is right there at ~/.sessionmem/memories.db – readable, deletable, no lock-in.

How the memory works

After each session, sessionmem generates a compact summary capturing: what you were building, key decisions made, files touched, and what’s left to do. Next time you start a session, this gets injected automatically before you type anything.

The summaries get better at capturing what matters in your specific workflow over time.

Links

Would love feedback if you try it out – especially on whether the right context is being captured in the summaries.

원문에서 계속 ↗

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다