DEV Community

Igor Ganapolsky
Igor Ganapolsky

Posted on

I gave Claude Code persistent memory — it stopped repeating the same mistakes

I gave Claude Code persistent memory — it stopped repeating the same mistakes

Every Claude Code session starts fresh. Your agent breaks the same thing it broke yesterday. You fix it again. Then again next week.

I built MCP Memory Gateway to solve this.

How it works

  1. During any coding session, give thumbs-up/down feedback with brief context
  2. Signals stored locally in LanceDB vector store
  3. Future sessions query this history before acting
  4. After 3+ identical failures: auto-generates a CLAUDE.md prevention rule
  5. Export DPO pairs for fine-tuning your own model

Install in 30 seconds (free, self-hosted)

npx rlhf-feedback-loop serve
Enter fullscreen mode Exit fullscreen mode

Add to your .mcp.json:

{
  "mcpServers": {
    "rlhf-feedback-loop": {
      "command": "npx",
      "args": ["-y", "rlhf-feedback-loop", "serve"]
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Works with Claude Code, Codex CLI, Gemini CLI, Amp, Cursor.

Hosted version ($10/mo)

Team-shared memory, managed vector search, web dashboard:
https://rlhf-feedback-loop-production.up.railway.app

GitHub

https://github.com/IgorGanapolsky/mcp-memory-gateway

MIT licensed. 698 tests passing. On the official MCP registry.

Top comments (0)