gitmem

A GitMem integration for coding agents through MCP, where MCP is a standard connection between an agent and an external tool. It helps the agent recall lessons, apply them, record new mistakes or successes, and preserve unfinished work between sessions.

In plain words
What is it for?
Use it to initialize GitMem in a project, set up its memory files and lifecycle hooks, and give the agent a recall-and-learn workflow.
Why use it?
It reduces repeated mistakes and prevents useful project knowledge from disappearing when an agent session ends. It is intended to store learned project context rather than ordinary chat history.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/gitmem-dev/gitmem/openclaw
Any agent
npx skills add gitmem-dev/gitmem --skill openclaw
Clone the repo
git clone --depth 1 https://github.com/gitmem-dev/gitmem

Made for: Claude Code, Codex.

Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,285 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00067 $0.01285
Opus 5 $0.00034 $0.00642
Sonnet 5 $0.00013 $0.00257
Haiku 4.5 $0.00007 $0.00128

Measured yesterday against content hash b73539f0cfe4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gitmem scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

distribution/openclaw/SKILL.md · 146 lines

How it starts

The opening of the file, as written. The whole thing — 146 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GitMem — Institutional Memory for AI Agents

Your agent starts from zero every session. GitMem fixes that.

It's an MCP server that gives your agent persistent memory across sessions — not chat history, but earned knowledge: mistakes to avoid, approaches that worked, architectural decisions, and unfinished work.

Setup

1. Add the MCP server

openclaw mcp add gitmem -- npx -y gitmem-mcp

Or add manually to ~/.openclaw/mcp.json:

{
  "mcpServers": {
    "gitmem": {
      "command": "npx",
      "args": ["-y", "gitmem-mcp@latest"]
    }
  }
}

2. Initialize in your project

cd your-project
npx gitmem-mcp init

The wizard creates:

  • .gitmem/ directory with 3 starter scars
  • Memory protocol instructions for your agent
  • Lifecycle hooks for automatic session management

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

How It Works

recall  →  work  →  learn  →  close  →  recall  →  ...
  1. Recall — Before acting, the agent checks memory for relevant lessons
  2. Work — The agent applies past lessons automatically
  3. Learn — Mistakes become scars, successes become wins
  4. Close — Session reflection persists context for next time

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 + rationale "Chose JWT over session cookies for stateless auth"
Threads Unfinished work across sessions "Rate limiting still needs implementation"

Every scar includes counter-arguments — reasons why someone might reasonably ignore it. This prevents memory from becoming rigid rules.

Tools Reference

Once the MCP server is running, your agent gets these tools:

Read the full file on GitHub · 146 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 146 lines · 67 tokens per session scan A b73539f0cfe4

Subscribe to this mod's changes

gitmem is a skill published in the GitHub repository gitmem-dev/gitmem (9 stars, last pushed 23d ago), licensed MIT. It adds 67 tokens to every session and 1,285 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

microsoft-docs

Query official Microsoft documentation to find concepts, tutorials, and code examples across Azure, .NET, Agent Framework, Aspire, VS Code, GitHub, and more. Uses Microsoft Learn MCP as the default, with Context7 and Aspire MCP for content that lives outside learn.microsoft.com.

microsoft/ai-agents-for-beginners · 61 tokens

testing-course-samples

Use when asked to validate, test, smoke-test, or run the course's notebook and code samples against a live Microsoft Foundry / Azure OpenAI configuration. Covers environment setup (.env, az login, packages), the scripts/validate-notebooks.ps1 runner, interpreting PASS/FAIL results, and which lessons need extra…

microsoft/ai-agents-for-beginners · 86 tokens

copilotkit-self-update

Use when the user wants to update, refresh, or reinstall the CopilotKit agent SKILLS (the SKILL.md files that teach this agent about CopilotKit). NOT for updating the CopilotKit codebase or project — this is specifically about refreshing the skills/knowledge this agent has loaded. Triggers on "update copilotkit…

CopilotKit/CopilotKit · 144 tokens

docs-writer

Draft or rewrite Strands Agents documentation pages. Use when writing new doc pages, rewriting pages that failed audit, drafting sections for existing pages, or writing blog posts and release notes about Strands. Also triggers on "write a doc", "draft a page", "rewrite the quickstart", "add a tutorial for X"…

strands-agents/harness-sdk · 74 tokens

docs-planner

Identify documentation gaps and prioritize the docs backlog. Use when planning a docs improvement sprint, after signals surface repeated friction, when new SDK features ship without docs, or for periodic health assessment. Also triggers on "plan docs work", "what docs need writing", "prioritize the backlog", "docs…

strands-agents/harness-sdk · 73 tokens

tutorial

Interactive tutorial teaching Ouroboros hands-on.

Q00/ouroboros · 10 tokens