GitMem

GitMem — Institutional memory for AI coding agents

GitMem — Institutional memory for AI coding agents

What is GitMem?

Every time an AI agent makes a mistake, fixes a bug, or discovers a better approach, that knowledge disappears when the session ends. GitMem is an MCP server that gives AI coding agents persistent institutional memory — the ability to learn from mistakes, remember what works, track decisions, and carry context across sessions and projects.

It's not a note-taker. It's a memory system with teeth: scars surface automatically before the agent repeats a mistake, sessions close with structured reflection, and open threads carry forward so nothing falls through the cracks. One npx gitmem-mcp init and every session builds on the last — mistakes, wins, decisions, and human corrections compound into an agent that gets sharper in your dev context over time.

Quick Start

npx gitmem-mcp init

One command sets up everything: .gitmem/ directory, .mcp.json, CLAUDE.md, hooks, and permissions. Already have existing config? The wizard merges without destroying anything.

How It Works

Recall before acting

Before consequential actions, the agent checks institutional memory. Relevant scars surface automatically with severity and counter-arguments.

recall({ plan: "deploy to production" })
// → "Done ≠ Deployed ≠ Verified Working" (high severity)
// → "Database migrations must run before code deploy" (critical)

Confirm and apply

Each scar must be acknowledged — APPLYING (with evidence), N_A (with reasoning), or REFUTED (acknowledging risk). No passive dismissal.

Learn from outcomes

When something breaks or works well, capture it. Scars require counter-arguments to prevent knowledge bloat.

create_learning({
  learning_type: "scar",
  title: "OAuth redirect URI must match exactly",
  severity: "medium",
  counter_arguments: [
    "In development, localhost variations are usually fine",
    "Some providers support wildcard redirects"
  ]
})

Close and persist

Session close captures reflections, records scar usage, and persists open threads for the next session.

Key Features

FeatureDescription
Automatic RecallBefore taking action, agents check institutional memory for relevant lessons
Confirm ProtocolScars require active acknowledgment — APPLYING, N_A, or REFUTED
Session ContinuityContext carries across sessions via threads, decisions, and rapport notes
Multi-AgentTeams of agents share the same institutional memory via prepare_context
MCP NativeWorks with Claude Code, Claude Desktop, Cursor, and any MCP client
Free TierLocal .gitmem/ storage with 23 tools, no external dependencies

23 tools, zero cost

The free tier includes session management, scar recall, learning creation, threads, and analytics — all stored locally in .gitmem/. No account, no API key, no cloud dependency.

Explore