Context Memory MCP Server
Tracks mistakes and solutions from past Claude sessions to avoid repeating failed approaches.
README
Context Memory MCP Server
An MCP server for tracking mistakes and solutions. Don't repeat what failed.
What This Is
Context Memory is a simple tool that helps Claude learn from your past sessions. It stores two things:
- Mistakes - approaches that failed and why
- Solutions - problems you solved and how
Before trying something, Claude can check if you've been down that road before. After solving something tricky, you can save it for next time.
Why This Exists
The Original Problem (2025)
When this project started, Claude Code had a significant limitation: conversation compression. As context windows filled up, Claude would compress older messages to make room. This meant losing valuable context:
- Why you chose one approach over another
- Edge cases you discovered along the way
- Failed attempts and what broke
- Handoff context between specialized agents
The original v0.x built an elaborate system to preserve all of this: notes, file decisions, agent handoffs, problem caches, session management. It worked, but it was complex.
What Changed
Claude Code got smarter. A lot smarter.
The compression that once destroyed context now preserves what matters. Claude maintains its own understanding of the conversation, the codebase, and the decisions being made. Most of what v0.x did became redundant—Claude handles it natively now.
But one thing Claude still can't do: learn from sessions it wasn't part of.
If you spent two hours debugging an authentication issue last week, and hit the same issue today in a new session, Claude starts from zero. It will suggest the same failed approaches. It doesn't know what you already tried.
The v1.0 Refocus
Version 1.0 strips away everything Claude now handles itself and focuses on the one remaining gap: cross-session learning from failures.
The API went from 8+ tools to 4:
| Tool | Purpose |
|---|---|
mistake |
Record what you tried and why it failed |
learned |
Save a problem/solution pair that worked |
recall |
Search for relevant past context |
promote |
Export important learnings to CLAUDE.md |
That's it. Simple, focused, useful.
Installation
Claude Code CLI
Add to your project's .mcp.json:
{
"mcpServers": {
"context-memory": {
"command": "npx",
"args": ["-y", "github:Dithilli/context-memory-mcp"]
}
}
}
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"context-memory": {
"command": "npx",
"args": ["-y", "github:Dithilli/context-memory-mcp"]
}
}
}
Tools
mistake
Record an approach that didn't work.
{
"what": "Tried using localStorage for auth tokens",
"why_failed": "XSS vulnerability - any script can read localStorage",
"tags": ["security", "auth"],
"files": ["src/auth/storage.ts"]
}
learned
Save a problem/solution pair.
{
"problem": "Supabase RLS returns empty array instead of 401",
"solution": "Add explicit auth check before query - RLS fails silently",
"tags": ["supabase", "auth"]
}
recall
Search past mistakes and solutions.
{
"query": "authentication",
"tags": ["security"],
"limit": 10
}
promote
Export a learning to CLAUDE.md for permanent reference.
{
"id": "solution-123",
"type": "solution"
}
Storage
Data is stored in ~/.context-memory/ by default:
mistakes.jsonl- Failed approachessolutions.jsonl- Working solutions
Custom Location
Use --storage-dir for per-project or custom storage:
{
"mcpServers": {
"context-memory": {
"command": "npx",
"args": [
"-y",
"github:Dithilli/context-memory-mcp",
"--storage-dir",
".context-memory"
]
}
}
}
Project Auto-Detection
The server automatically detects your project from the git root, so mistakes and solutions are tagged with project context without manual configuration.
When to Use This
Do use it for:
- "We tried X, it failed because Y" - saves hours of repeated debugging
- Tricky solutions that aren't obvious from the code
- Patterns that apply across projects
Don't use it for:
- General notes (Claude remembers within a session)
- Implementation details (that's what git history is for)
- Obvious things (trust Claude to figure those out)
Migration from v0.x
If you have data from v0.x, the server will automatically migrate it on first run:
- Old
notes.jsonlentries become mistakes - Old
problems.jsonlentries become solutions - Handoffs and file decisions are archived (no longer needed)
Changelog
v1.0.0 (2026-01-23)
- Breaking change: Simplified API to four tools:
mistake,learned,recall,promote - Added project auto-detection from git root
- Added
promotetool to export learnings to CLAUDE.md - Automatic migration from v0.x data format
- Removed handoffs, notes, and file decisions (Claude Code handles these natively now)
v0.2.0 (2025-01-12)
- Added configurable storage directory (
--storage-diroption) - Support for per-project storage
v0.1.0 (2025-01-12)
- Initial release with full context preservation system
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.