# gitmem

gitmem keeps decisions, mistakes, and unfinished work available across AI agent sessions. Use it when a project needs durable working context.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 9
- Author: gitmem-dev
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/gitmem-dev/gitmem
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/gitmem

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `SUPABASE_URL`, `SUPABASE_SERVICE_ROLE_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env SUPABASE_URL=<SUPABASE_URL> --env SUPABASE_SERVICE_ROLE_KEY=<SUPABASE_SERVICE_ROLE_KEY> --transport stdio gitmem -- npx -y gitmem-mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add gitmem --env SUPABASE_URL=<SUPABASE_URL> --env SUPABASE_SERVICE_ROLE_KEY=<SUPABASE_SERVICE_ROLE_KEY> -- npx -y gitmem-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e SUPABASE_URL=<SUPABASE_URL> -e SUPABASE_SERVICE_ROLE_KEY=<SUPABASE_SERVICE_ROLE_KEY> gitmem npx -y gitmem-mcp
```
Replace <…> with your own values

## When to use it
- 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
- 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.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119231
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47577
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43902

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
