gitmem — Claude Code MCP server: memory and setup
gitmem keeps decisions, mistakes, and unfinished work available across AI agent sessions. Use it when a project needs durable working context.
claude mcp add --env SUPABASE_URL=<SUPABASE_URL> --env SUPABASE_SERVICE_ROLE_KEY=<SUPABASE_SERVICE_ROLE_KEY> --transport stdio gitmem -- npx -y gitmem-mcpWhat gitmem does
gitmem adds an MCP server that gives an AI coding agent memory across sessions. It stores mistakes as scars, successful approaches as wins, reusable patterns, architectural decisions, and open threads. Before similar work, the agent can retrieve related lessons; session closing records new context for later use.
Its initializer creates .gitmem/, MCP configuration, an instruction file, and supported lifecycle hooks. Existing configuration is merged, while --dry-run previews the changes. The Claude Code setup command requires SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY, so the server will not connect without those values. The package provides 20+ MCP tools for memory, search, threads, and multi-agent coordination.
What it helps with
- carry architectural decisions into later sessions
- surface previous mistakes before related changes
- keep unfinished work available after a session ends
- record approaches that worked for the agent
Example prompts for the agent
- Remember this authentication decision for future sessions.
- Check earlier lessons about this module before changing its database access.
- Close the session and save what failed, what worked, and what remains.
How to install gitmem
Platform CLI
claude mcp add --env SUPABASE_URL=<SUPABASE_URL> --env SUPABASE_SERVICE_ROLE_KEY=<SUPABASE_SERVICE_ROLE_KEY> --transport stdio gitmem -- npx -y gitmem-mcpReplace <…> with your own values
Platform CLI
codex mcp add gitmem --env SUPABASE_URL=<SUPABASE_URL> --env SUPABASE_SERVICE_ROLE_KEY=<SUPABASE_SERVICE_ROLE_KEY> -- npx -y gitmem-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"gitmem": {
"command": "npx",
"args": [
"-y",
"gitmem-mcp"
],
"env": {
"SUPABASE_URL": "<SUPABASE_URL>",
"SUPABASE_SERVICE_ROLE_KEY": "<SUPABASE_SERVICE_ROLE_KEY>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"gitmem": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"gitmem-mcp"
],
"env": {
"SUPABASE_URL": "<SUPABASE_URL>",
"SUPABASE_SERVICE_ROLE_KEY": "<SUPABASE_SERVICE_ROLE_KEY>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e SUPABASE_URL=<SUPABASE_URL> -e SUPABASE_SERVICE_ROLE_KEY=<SUPABASE_SERVICE_ROLE_KEY> gitmem npx -y gitmem-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about gitmem
How do I install gitmem in Claude Code?
Run `claude mcp add --env SUPABASE_URL=<SUPABASE_URL> --env SUPABASE_SERVICE_ROLE_KEY=<SUPABASE_SERVICE_ROLE_KEY> --transport stdio gitmem -- npx -y gitmem-mcp`.
What does gitmem do?
It gives an AI coding agent memory between sessions, including mistakes, successful approaches, patterns, decisions, and unfinished work. Related records can be recalled during later tasks.
What does gitmem need to connect?
The Claude Code command needs SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY. gitmem also supports Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, and Gemini CLI.