Context Memory MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Context Memory MCP Serversearch for past mistakes with authentication"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
Related MCP server: project-brain-mcp
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 |
| Record what you tried and why it failed |
| Save a problem/solution pair that worked |
| Search for relevant past context |
| 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 mistakesOld
problems.jsonlentries become solutionsHandoffs 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,promoteAdded project auto-detection from git root
Added
promotetool to export learnings to CLAUDE.mdAutomatic 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
Available Tools
4 toolslearnedB
Cache a problem/solution pair for future reference
| Name | Required | Description | Default |
|---|---|---|---|
| tags | Yes | Tags for categorization | |
| files | No | Related file paths (optional) | |
| problem | Yes | The problem that was solved | |
| solution | Yes | How it was solved |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden for behavioral disclosure. It only states 'Cache' without explaining persistence, overwrite semantics, scope, or how cached items are retrieved. This leaves significant ambiguity for an agent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, front-loaded with the verb 'cache', no wasted words. It concisely conveys the action and object.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is a simple cache operation, but the description lacks integration with sibling tools and doesn't explain the lifecycle of cached items (e.g., whether they can be recalled later). Given that the schema is complete but the overall narrative is thin, the description is not fully self-sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema covers 100% of parameters with descriptions, so the baseline is 3. The description adds no additional parameter context beyond the schema's own field descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses the specific verb 'cache' and resource 'problem/solution pair', clearly indicating the action. It does not explicitly distinguish from sibling tools like 'mistake' or 'recall', but the core purpose is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit when-to-use guidance or alternatives are mentioned. The context of sibling tools suggests a memory system, but the description alone only implies caching after a problem is solved, leaving the exact usage scenario implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mistakeC
Record something that failed so you don't repeat it
| Name | Required | Description | Default |
|---|---|---|---|
| why | Yes | Why it failed or didn't work | |
| tags | Yes | Tags for categorization (e.g., ["typescript", "auth"]) | |
| what | Yes | What was tried (brief description) | |
| files | No | Related file paths (optional) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It only states 'Record' which implies a write operation, but gives no details on side effects, persistence, idempotency, return values, or required permissions. The purpose clause ('so you don't repeat it') is motivational, not behavioral.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no filler or repetition. Every word contributes meaning. It is appropriately sized for a simple recording tool, though it could benefit from more context without becoming bloated.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 4 parameters (3 required) and no output schema or annotations, the description is too sparse to provide complete context. It does not mention the required input fields, any side effects, or how this integrates with sibling tools. The agent is left to infer most operational details from the schema alone.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% parameter description coverage, so the baseline is 3. The tool description does not add any parameter-specific meaning, but it also does not conflict with the schema. The schema already explains 'what', 'why', 'tags', and 'files' adequately.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Record') and the target resource ('something that failed'), plus the intended benefit ('so you don't repeat it'). It is not a tautology and meaningfully distinguishes from the name. However, it does not explicitly differentiate from sibling tools like 'learned' or 'recall', which could have overlapping purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. The description implies a use case (when something fails) but does not state exclusions, prerequisites, or contextual triggers. Sibling tools are listed but not described, so the agent cannot make an informed choice.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
promoteC
Export a learning to CLAUDE.md for permanent reference
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the mistake or solution to promote | |
| section | No | Section header to add under (default: "## Lessons Learned") | |
| target_file | No | Path to CLAUDE.md (defaults to ./CLAUDE.md) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states only 'Export a learning to CLAUDE.md' but does not explain whether this appends or overwrites content, whether it creates missing files, or what happens to the source learning. No side effects or permissions are mentioned.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, with no redundant words. It immediately states the action and destination, making it efficient and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool mutates a file and has no annotations or output schema, the description is too sparse. It does not clarify important behaviors like idempotency, formatting of the promoted entry, or how 'section' interacts with existing content. Sibling context suggests a workspace but the description doesn't establish how this fits.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema covers all three parameters with descriptions, so the baseline is 3. The description's mention of 'CLAUDE.md' aligns with the target_file parameter but adds no semantic detail beyond the schema. No extra meaning is provided for 'id' or 'section'.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses the specific verb 'Export' and names the resource 'a learning' and destination 'CLAUDE.md', making the tool's function clear. While it doesn't explicitly contrast with sibling tools, the destination file distinguishes it from 'mistake', 'learned', and 'recall'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description offers no guidance on when to use this tool versus siblings like 'learned' or 'recall'. There is no mention of scenarios, prerequisites, or exclusions, leaving usage entirely to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
recallC
Search for relevant mistakes and solutions
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Filter by tags (optional) | |
| limit | No | Max results to return (default: 10) | |
| query | Yes | Search query (fuzzy matched against content) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden, but it only states a search action without disclosing behavioral traits such as return format, default limits, sorting, or whether results are fuzzy-matched. The schema mentions 'fuzzy matched', but the description itself does not provide this context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that front-loads the core action. It avoids unnecessary detail, though it is arguably under-specifying, which is penalized elsewhere. The structure is efficient for its length.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with no output schema and no annotations, the description is incomplete. It does not explain what the search returns, how results are ordered, or the effect of optional parameters. The agent is left without expectations for the tool's output, making correct invocation harder.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds no parameter-specific meaning beyond what the schema already documents, but the schema is sufficient with clear descriptions for query, tags, and limit.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description specifies the verb 'Search' and the resource 'mistakes and solutions', making the primary purpose clear. It does not explicitly contrast with siblings, but the search action implies a distinct role among the sibling tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus the sibling tools (mistake, learned, promote). The description implies searching past mistakes, but there are no explicit alternatives or exclusions, leaving the agent without decision support.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
4 tool updates
v1.0.0- First observed
learned - First observed
mistake - First observed
promote - First observed
recall
TDQS
Each tool targets a distinct action: recording failures, recording solutions, searching, and exporting. The descriptions clearly differentiate the purposes, so selection ambiguity is low.
The tool names use mixed conventions: 'recall' and 'promote' are verbs, while 'mistake' and 'learned' are nouns/past participles. There is no consistent verb_noun pattern, making it harder to predict tool behavior from the name.
Four tools is well-scoped for a memory/learning management server, covering the core operations without excessive fragmentation.
The server covers recording (mistakes/learnings), recall, and promotion to permanent storage, but lacks update and delete operations for managing existing memories. This leaves a notable gap for correcting or removing outdated information.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Persistent, governed institutional memory for Claude Code — specs, decisions, learnings.
Knowledge accumulation for AI coding agents. Records decisions, problems, and insights as context.
Give Claude an honest self-model — behavioral tendencies built from evidence, not session memory. Mi
Never let your agent repeat a bug or linger on a known issue. Search 385+ failure lessons to skip known errors instantly.
Related MCP Servers
- AlicenseCqualityCmaintenanceDaem0n-MCP provides AI agents with persistent, semantically indexed memory to track decisions, rules, and outcomes across sessions. It actively prevents repetitive mistakes by enforcing context checks and prioritizing information about past failures during recall. Best for Claude Code.1173MIT
- AlicenseNot gradedqualityDmaintenanceEngineering memory for Claude Code — prevents re-investigating solved problems and repeating rejected architectural decisions across sessions and projects.Apache 2.0
- AlicenseAqualityFmaintenancePersistent memory and automatic git snapshots for Claude Code, capturing decisions, patterns, and architecture across sessions.107698MIT
- AlicenseNot gradedqualityDmaintenancePersistent session memory for Claude Code, providing episodic recall across sessions via structured markdown logs and BM25 search.1MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Dithilli/context-memory-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server