GitMem
OfficialProvides persistent cloud storage and semantic search for GitMem's memory, leveraging Supabase as the backend for the Pro tier.
Click on "Deploy 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., "@GitMem remember this failing test as a scar"
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.
GitMem is an MCP server that gives your AI coding agent persistent learning memory across agent sessions. It remembers mistakes (scars), successes (wins), and decisions — so your agent learns from experience instead of starting from scratch every time.
What's MCP? Model Context Protocol is how AI coding tools connect to external capabilities. GitMem is an MCP server — install it once and your agent gains persistent memory.
Works with Claude Code, Cursor, VS Code (Copilot), Windsurf, and any MCP-compatible client.
Quick Start
npx gitmem-mcp initOne command. The wizard auto-detects your IDE and sets up everything:
.gitmem/directory with starter scarsMCP server config (
.mcp.json,.vscode/mcp.json,.cursor/mcp.json, etc.)Instructions file (
CLAUDE.md,.cursorrules,.windsurfrules,.github/copilot-instructions.md)Lifecycle hooks (where supported)
.gitignoreupdated
Already have existing config? The wizard merges without destroying anything. Re-running is safe.
npx gitmem-mcp init --yes # Non-interactive
npx gitmem-mcp init --dry-run # Preview changes
npx gitmem-mcp init --client vscode # Force specific clientRelated MCP server: repomemory
How It Works
recall --> work --> learn --> close --> recall --> ...Recall — Before acting, the agent checks memory for relevant lessons from past sessions
Work — The agent does the task, applying past lessons automatically
Learn — Mistakes become scars, successes become wins, strategies become patterns
Close — Session reflection persists context for next time
Every scar includes counter-arguments — reasons why someone might reasonably ignore it. This prevents memory from becoming a pile of rigid rules.
What Gets Remembered
Type | Purpose | Example |
Scars | Mistakes to avoid | "Always validate UUID format before DB lookup" |
Wins | Approaches that worked | "Parallel agent spawning cut review time by 60%" |
Patterns | Reusable strategies | "5-tier test pyramid for MCP servers" |
Decisions | Architectural choices with rationale | "Chose JWT over session cookies for stateless auth" |
Threads | Unfinished work that carries across sessions | "Rate limiting still needs implementation" |
Key Features
Automatic Recall — Scars surface before the agent takes similar actions
Session Continuity — Context, threads, and rapport carry across sessions
Closing Ceremony — Structured reflection captures what broke, what worked, and what to do differently
20+ MCP Tools — Full toolkit for memory management, search, threads, and multi-agent coordination
Zero Config —
npx gitmem-mcp initand you're runningNon-Destructive — Merges with your existing
.mcp.json,CLAUDE.md, and hooks
Supported Clients
Client | Setup | Hooks |
Claude Code |
| Full (session, recall, credential guard) |
Cursor |
| Partial (session, recall) |
VS Code (Copilot) |
| Instructions-based |
Windsurf |
| Instructions-based |
Claude Desktop | Add to | Manual |
Any MCP client |
| Instructions-based |
The wizard auto-detects your IDE. Use --client to override.
Add this to your MCP client's config file:
{
"mcpServers": {
"gitmem": {
"command": "npx",
"args": ["-y", "gitmem-mcp@latest"]
}
}
}Client | Config file |
Claude Code |
|
Cursor |
|
VS Code |
|
Windsurf |
|
CLI Commands
Command | Description |
| Interactive setup wizard (auto-detects IDE) |
| Setup for specific client ( |
| Non-interactive setup |
| Preview changes |
| Activate Pro tier (auto-applies schema) |
| Remove Pro credentials, free device slot |
| Output schema SQL (for manual Supabase setup) |
| Clean removal (preserves |
| Full removal including data |
| Diagnostic health check |
Pro Tier
Self-hosted on your own Supabase. You bring the infrastructure, gitmem sets it up.
What you get | Why your agent cares |
Semantic search | Recall returns the right scars, not keyword noise |
Session analytics | Spot patterns in what keeps going wrong |
Sub-agent briefing | Hand institutional context to sub-agents automatically |
Cloud persistence | Memory survives machine changes, shareable across team |
A/B testing analytics | Measure which scar phrasings actually change agent behavior |
Quick start
npx supabase login # one time
export SUPABASE_URL="https://yourproject.supabase.co"
export SUPABASE_SERVICE_ROLE_KEY="eyJ..."
export OPENROUTER_API_KEY="sk-or-v1-..."
npx gitmem-mcp activate <your-license-key>The activate command creates all tables, views, RPC functions, and indexes automatically. No manual SQL needed.
See docs/pro-setup-guide.md for the full guide.
The free tier gives you everything for solo projects. Pro makes recall smarter and memory portable.
GitMem + MEMORY.md
Your AI agent likely has its own memory file (MEMORY.md, .cursorrules, etc.). Here's how they work together:
MEMORY.md | GitMem | |
Loaded | Every turn (system prompt) | On-demand (tool calls) |
Best for | Preferences, shortcuts, quick reference | Earned lessons, unfinished work, decisions |
Updates | Agent writes directly | Session lifecycle (close ceremony) |
Example | "User prefers terse output" | "Always validate UUID before DB lookup" |
Tip: Include .gitmem/agent-briefing.md in your MEMORY.md for a lightweight bridge between the two systems.
Privacy & Data
Local-first — All data stored in
.gitmem/on your machine by defaultNo telemetry — GitMem does not collect usage data or phone home
Cloud opt-in — Pro tier Supabase backend requires explicit configuration via environment variables
Your data — Sessions, scars, and decisions belong to you. Delete
.gitmem/to remove everything
Development
git clone https://github.com/gitmem-dev/gitmem.git
cd gitmem
npm install
npm run build
npm testSee CONTRIBUTING.md for full development setup.
License
MIT — see LICENSE.
Available Tools
30 toolsabsorb_observationsA
Capture observations from sub-agents and teammates. The lead agent parses findings from sub-agent responses, then calls this to persist and analyze them. Identifies scar candidates.
Inputs: observations (required), task_id.
analyzeB
Session analytics and insights engine. Returns formatted markdown by default. Use format=json for raw data.
Inputs: days, lens, agent, format, +1 more.
archive_learningA
Archives a learning (scar/win/pattern) by setting is_active=false and recording archived_at timestamp. Archived learnings are excluded from recall and search results but preserved for audit trail.
Inputs: id (required), reason.
cleanup_threadsA
Triage open threads by lifecycle health. Groups threads as active/cooling/dormant with vitality scores. Use auto_archive=true to archive threads dormant 30+ days. Review and resolve stale threads to keep your thread list healthy.
Inputs: project, auto_archive.
confirm_scarsA
Confirm surfaced scars with APPLYING/N_A/REFUTED decisions and evidence. REQUIRED after recall() before consequential actions. Each recalled scar must be addressed. APPLYING: past-tense evidence of compliance. N_A: explain why scar doesn't apply. REFUTED: acknowledge risk of overriding.
Inputs: confirmations (required).
contribute_feedbackA
Submit feedback about gitmem — feature requests, bug reports, friction points, or suggestions. Always saved locally to .gitmem/feedback/. If opted in, sent anonymously to improve gitmem. 10/session limit.
Inputs: tool (required), type (required), severity (required), description (required), +2 more.
create_decisionB
Log architectural/operational decision to institutional memory
Inputs: title (required), decision (required), rationale (required), project, +5 more.
create_learningA
Create scar, win, or pattern entry in institutional memory. Frame as 'what we now know' — lead with the factual/architectural discovery, not what went wrong. Good: 'Fine-grained PATs are scoped to one resource owner'. Bad: 'Should have checked PAT type first'.
Inputs: title (required), description (required), learning_type (required), domain, +9 more.
create_threadA
Create an open thread to track unresolved work across sessions. Includes semantic dedup: if a similar open thread exists (cosine similarity > 0.85), returns the existing thread instead. Check the 'deduplicated' field in the response.
Inputs: text (required), linear_issue.
dismiss_suggestionA
Dismiss a suggested thread. Incremented dismiss count — suggestions dismissed 3+ times are permanently suppressed.
Inputs: suggestion_id (required).
gitmem-cache-flushB
gitmem-cache-flush - Force reload cache from Supabase (use when out of sync)
Inputs: project.
gitmem-cache-healthB
gitmem-cache-health - Compare local cache against remote Supabase (detect out-of-sync)
Inputs: project.
gitmem-cache-statusA
gitmem-cache-status - Show local search cache status (scar count, age, staleness)
Inputs: project.
gitmem-helpA
gitmem-help - Show available commands with ASCII art header
Inputs: no named parameters.
graph_traverseA
Traverse the knowledge graph over institutional memory triples. Answers: 'show me everything connected to this issue', 'what did this agent produce', 'trace this decision back', 'which issues produced the most learnings'. Four lenses: connected_to, produced_by, provenance, stats.
Inputs: lens (required), node, depth, limit, +2 more.
healthA
Show write health for the current session. Reports success/failure rates for all tracked fire-and-forget operations (metrics, cache, triple writes, embeddings, scar usage). Use this to diagnose silent failures.
Inputs: failure_limit.
index_docsA
Scan a directory of markdown files, chunk them, embed them, and store them in a local doc index for semantic search. Supports incremental indexing: only re-processes changed files. Use search_docs to query the indexed docs.
Inputs: directory (required), clear, force, exclude, +1 more.
list_threadsA
List open threads across recent sessions. Shows unresolved work items that carry over between sessions. Use resolve_thread to mark threads as done.
Inputs: status, project, include_resolved.
logA
List recent learnings chronologically (like git log). Shows scars, wins, and patterns ordered by creation date.
Inputs: limit, since, project, severity, +1 more.
prepare_contextA
Generate portable memory payload for sub-agent injection. Formats institutional memory into compact or gate payloads that fit in Task tool prompts.
Inputs: plan (required), format (required), project, agent_role, +1 more.
promote_suggestionA
Promote a suggested thread to an open thread. Takes a suggestion_id from session_start's suggested_threads list and creates a real thread from it.
Inputs: suggestion_id (required), project.
recallB
Check institutional memory for relevant scars before taking action. Returns matching scars and their lessons. Integrates variant assignment when issue_id provided.
Inputs: plan (required), project, issue_id, match_count, +1 more.
record_scar_usageB
Track scar application for effectiveness measurement
Inputs: scar_id (required), surfaced_at (required), reference_type (required), reference_context (required), +7 more.
reflect_scarsA
End-of-session scar reflection — the closing counterpart to confirm_scars. Mirrors CODA-1's [Scar Reflection] protocol. Call BEFORE session_close to provide evidence of how each surfaced scar was handled. OBEYED: concrete evidence of compliance (min 15 chars). REFUTED: why it didn't apply + what was done instead (min 30 chars). Session close uses reflections to set execution_successful accurately.
Inputs: reflections (required).
resolve_threadA
Mark an open thread as resolved. Use thread_id for exact match or text_match for fuzzy matching. Updates session state and .gitmem/threads.json.
Inputs: thread_id, text_match, resolution_note.
searchA
Search institutional memory by query. Unlike recall (which is action-oriented), search is exploration-oriented — returns matching scars/wins/patterns without side effects.
Inputs: query (required), project, severity, match_count, +1 more.
search_docsA
Search indexed repository documentation using semantic similarity (pro/dev tier) or BM25 keyword search (free tier). Returns relevant chunks with file paths for targeted reading. Index docs first with index_docs.
Inputs: query (required), project, category, match_count.
session_closeA
Persist session with compliance validation. Two modes: (1) Write closing_reflection and other payload to {gitmem_dir}/closing-payload.json, then call with session_id + close_type. (2) Pass closing_reflection directly as a parameter (simpler). Both work — inline params override file payload. task_completion is auto-generated. DISPLAY: Output the display field verbatim.
Inputs: close_type (required), session_id (required), linear_issue, human_corrections, +2 more.
session_refreshA
Re-surface institutional context (threads, decisions) for the current active session without creating a new session. Use mid-session when you need to remember where you left off, after context compaction, or after a long gap. DISPLAY: The result includes a pre-formatted 'display' field visible in the tool result. Output the display field verbatim as your response — tool results are collapsed in the CLI.
Inputs: project.
session_startA
Initialize session, detect agent, load institutional context (last session, recent decisions, open threads). Scars surface on-demand via recall(). DISPLAY: The result includes a pre-formatted 'display' field visible in the tool result. Output the display field verbatim as your response — tool results are collapsed in the CLI.
Inputs: force, project, issue_title, issue_labels, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 30 tools
Most tools have distinct purposes, e.g., recall is action-oriented while search is exploration-oriented, and cache tools are clearly separated. However, recall and search could still be confused, and confirm_scars vs reflect_scars have overlapping scope.
Tool names mix conventions: some use verb_noun (e.g., create_learning), some are single verbs (e.g., health, log), and some use gitmem- prefix (e.g., gitmem-cache-flush). This inconsistency makes the set feel less coherent.
With 30 tools, the server feels overloaded for memory management and session handling. Many tools could be consolidated (e.g., cache tools, thread tools), making the surface difficult to navigate.
The tool set covers core CRUD operations for learnings, threads, and decisions, plus session lifecycle and cache management. However, there are gaps like no update for learnings or delete for threads, and no explicit tool for editing decisions.
Maintenance
Related MCP Connectors
Cloud-hosted MCP server for durable AI memory
Persistent memory for AI agents to retain, retrieve, and recall conversation context through MCP.
Persistent AI memory shared across Claude, ChatGPT, coding agents, and compatible MCP clients.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenancePersistent memory for AI coding agents. Enables agents to save and recall decisions, patterns, bugs, and context across sessions via an MCP server with local SQLite storage.16 npm2MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that captures and recalls coding session memory (failures, decisions, diffs) for AI agents, enabling cross-agent continuity and preventing repeated mistakes.71 npmMIT
- AlicenseNot gradedqualityBmaintenancePersistent memory MCP server that remembers decisions and context across coding sessions, automatically logging and surfacing relevant knowledge as you work.51 npmMIT
- AlicenseNot gradedqualityBmaintenanceMCP server that gives AI agents persistent long-term memory, storing and recalling facts, decisions, errors, procedures, and episodes across sessions.51 npm5Apache 2.0