Skip to main content
Glama
Dithilli

Context Memory MCP Server

by Dithilli

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:

  1. Mistakes - approaches that failed and why

  2. 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

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 approaches

  • solutions.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.jsonl entries become mistakes

  • Old problems.jsonl entries 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 promote tool 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-dir option)

  • Support for per-project storage

v0.1.0 (2025-01-12)

  • Initial release with full context preservation system

License

MIT

Available Tools

4 tools
learnedB

Cache a problem/solution pair for future reference

ParametersJSON Schema
NameRequiredDescriptionDefault
tagsYesTags for categorization
filesNoRelated file paths (optional)
problemYesThe problem that was solved
solutionYesHow it was solved

TDQS

B3.2/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
whyYesWhy it failed or didn't work
tagsYesTags for categorization (e.g., ["typescript", "auth"])
whatYesWhat was tried (brief description)
filesNoRelated file paths (optional)

TDQS

C2.9/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesID of the mistake or solution to promote
sectionNoSection header to add under (default: "## Lessons Learned")
target_fileNoPath to CLAUDE.md (defaults to ./CLAUDE.md)

TDQS

C2.9/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
tagsNoFilter by tags (optional)
limitNoMax results to return (default: 10)
queryYesSearch query (fuzzy matched against content)

TDQS

C2.9/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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.

  1. 4 tool updatesv1.0.0
    • First observedlearned
    • First observedmistake
    • First observedpromote
    • First observedrecall

TDQS

B3.2/5.0
Disambiguation5/5

Each tool targets a distinct action: recording failures, recording solutions, searching, and exporting. The descriptions clearly differentiate the purposes, so selection ambiguity is low.

Naming Consistency2/5

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.

Tool Count5/5

Four tools is well-scoped for a memory/learning management server, covering the core operations without excessive fragmentation.

Completeness3/5

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

ActivityInactive
ResponsivenessNo issues

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

Related MCP Servers

  • A
    license
    C
    quality
    C
    maintenance
    Daem0n-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.
    11
    73
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Engineering memory for Claude Code — prevents re-investigating solved problems and repeating rejected architectural decisions across sessions and projects.
    Apache 2.0

Latest Blog Posts

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