io.github.gitmem-dev/gitmem

编码与调试

by gitmem-dev

Persistent institutional memory for AI coding agents. Memory that compounds.

什么是 io.github.gitmem-dev/gitmem

Persistent institutional memory for AI coding agents. Memory that compounds.

README

<p align="center"> <img src="assets/banner.svg" alt="GitMem — Institutional memory for AI coding agents" width="700" /> </p> <p align="center"> <a href="https://www.npmjs.com/package/gitmem-mcp"><img src="https://img.shields.io/npm/v/gitmem-mcp?style=flat-square&color=c41920&label=npm" alt="npm version" /></a> <a href="https://www.npmjs.com/package/gitmem-mcp"><img src="https://img.shields.io/npm/dm/gitmem-mcp?style=flat-square&color=333333&label=downloads" alt="npm downloads" /></a> <a href="https://github.com/gitmem-dev/gitmem/blob/main/LICENSE"><img src="https://img.shields.io/github/license/gitmem-dev/gitmem?style=flat-square&color=c41920" alt="MIT License" /></a> <a href="https://github.com/gitmem-dev/gitmem/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/gitmem-dev/gitmem/ci.yml?style=flat-square&color=333333&label=build" alt="Build" /></a> <img src="https://img.shields.io/badge/node-%3E%3D18-c41920?style=flat-square" alt="Node.js >= 18" /> </p> <p align="center"> <a href="https://gitmem.ai/docs"><strong>Documentation</strong></a> &middot; <a href="https://www.npmjs.com/package/gitmem-mcp"><strong>npm</strong></a> &middot; <a href="https://gitmem.ai/docs/getting-started"><strong>Getting Started</strong></a> &middot; <a href="https://gitmem.ai/docs/tools"><strong>Tool Reference</strong></a> </p>

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

bash
npx gitmem-mcp init

One command. The wizard auto-detects your IDE and sets up everything:

  • .gitmem/ directory with starter scars
  • MCP 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)
  • .gitignore updated

Already have existing config? The wizard merges without destroying anything. Re-running is safe.

bash
npx gitmem-mcp init --yes                # Non-interactive
npx gitmem-mcp init --dry-run            # Preview changes
npx gitmem-mcp init --client vscode      # Force specific client

How It Works

code
recall  -->  work  -->  learn  -->  close  -->  recall  -->  ...
  1. Recall — Before acting, the agent checks memory for relevant lessons from past sessions
  2. Work — The agent does the task, applying past lessons automatically
  3. Learn — Mistakes become scars, successes become wins, strategies become patterns
  4. 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

TypePurposeExample
ScarsMistakes to avoid"Always validate UUID format before DB lookup"
WinsApproaches that worked"Parallel agent spawning cut review time by 60%"
PatternsReusable strategies"5-tier test pyramid for MCP servers"
DecisionsArchitectural choices with rationale"Chose JWT over session cookies for stateless auth"
ThreadsUnfinished 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 Confignpx gitmem-mcp init and you're running
  • Non-Destructive — Merges with your existing .mcp.json, CLAUDE.md, and hooks

Supported Clients

ClientSetupHooks
Claude Codenpx gitmem-mcp initFull (session, recall, credential guard)
Cursornpx gitmem-mcp init --client cursorPartial (session, recall)
VS Code (Copilot)npx gitmem-mcp init --client vscodeInstructions-based
Windsurfnpx gitmem-mcp init --client windsurfInstructions-based
Claude DesktopAdd to claude_desktop_config.jsonManual
Any MCP clientnpx gitmem-mcp init --client genericInstructions-based

The wizard auto-detects your IDE. Use --client to override.

<details> <summary><strong>Manual MCP configuration</strong></summary>

Add this to your MCP client's config file:

json
{
  "mcpServers": {
    "gitmem": {
      "command": "npx",
      "args": ["-y", "gitmem-mcp"]
    }
  }
}
ClientConfig file
Claude Code.mcp.json
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Windsurf~/.codeium/windsurf/mcp_config.json
</details>

CLI Commands

CommandDescription
npx gitmem-mcp initInteractive setup wizard (auto-detects IDE)
npx gitmem-mcp init --client <name>Setup for specific client (claude, cursor, vscode, windsurf, generic)
npx gitmem-mcp init --yesNon-interactive setup
npx gitmem-mcp init --dry-runPreview changes
npx gitmem-mcp uninstallClean removal (preserves .gitmem/ data)
npx gitmem-mcp uninstall --allFull removal including data
npx gitmem-mcp checkDiagnostic health check

Pro Tier — Coming Soon

What you getWhy your agent cares
Semantic searchRecall returns the right scars, not keyword noise
Session analyticsSpot patterns in what keeps going wrong
Sub-agent briefingHand institutional context to sub-agents automatically
Cloud persistenceMemory survives machine changes, shareable across team
A/B testing analyticsMeasure which scar phrasings actually change agent behavior (free tier includes GITMEM_NUDGE_VARIANT for manual testing)

The free tier gives you everything for solo projects. Pro makes recall smarter and memory portable.

Join the mailing list to get notified.

GitMem + MEMORY.md

Your AI agent likely has its own memory file (MEMORY.md, .cursorrules, etc.). Here's how they work together:

MEMORY.mdGitMem
LoadedEvery turn (system prompt)On-demand (tool calls)
Best forPreferences, shortcuts, quick referenceEarned lessons, unfinished work, decisions
UpdatesAgent writes directlySession 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 default
  • No 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

bash
git clone https://github.com/gitmem-dev/gitmem.git
cd gitmem
npm install
npm run build
npm test

See CONTRIBUTING.md for full development setup.

License

MIT — see LICENSE.

常见问题

io.github.gitmem-dev/gitmem 是什么?

Persistent institutional memory for AI coding agents. Memory that compounds.

相关 Skills

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描114.1k

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描114.1k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描114.1k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
83.4k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
52.2k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
46.3k

评论