Borrowing it
Nothing to install: this file belongs to nerdyaustin/memory_mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/nerdyaustin/memory_mcp/main/CLAUDE.mdgit clone --depth 1 https://github.com/nerdyaustin/memory_mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/nerdyaustin/memory_mcp/claude-md)<a href="https://agentmods.dev/instructions/nerdyaustin/memory_mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/nerdyaustin/memory_mcp/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/nerdyaustin/memory_mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/nerdyaustin/memory_mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02200 | $0.02200 |
| Opus 5.5 | $0.00880 | $0.00880 |
| Sonnet 5.5 | $0.00440 | $0.00440 |
| Haiku 4.5 | $0.00220 | $0.00220 |
Grade A, and why
memory_mcp CLAUDE.md scanned grade A with 1 finding 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 2mo ago.
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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
**Test:** `tests/test_startup.py` measures wall time from `subprocess.Popen` to the `tools/list` response. Threshold is 1.5s on this machine; observed values are ~200–300ms cold, ~150–250ms warm. If this test starts fail How it starts
The opening of the file, as written. The whole thing — 179 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Memory MCP
Persistent memory and session search for AI coding assistants, exposed as an MCP server.
What this is
A Python MCP server that:
- Indexes session history from Claude Code (
~/.claude/projects/) and OMP (~/.omp/agent/sessions/) - Provides full-text search across all historical sessions via SQLite FTS5
- Offers explicit
save_memory/search_memorytools for cross-session knowledge persistence
No Flask, no Postgres, no file watchers. SQLite handles everything. The MCP SDK handles transport.
Architecture
memory_mcp/
server.py # FastMCP entry point, lifespan yields fast then runs scan in background
readiness.py # Lazy embedder + scan/backfill coordination (v0.3.0)
config.py # Auto-detects session dirs, DB path (~/.memory_mcp/memory.db)
db.py # SQLite + FTS5 + sqlite-vec schema, all query functions
embeddings.py # Lazy fastembed wrapper (BAAI/bge-small-en-v1.5)
scanner.py # Walks session dirs, dispatches to parsers, indexes into DB
parsers/
base.py # ParsedSession / ParsedMessage dataclasses, SessionParser protocol
claude_code.py # Claude Code JSONL parser (merges streamed assistant blocks)
omp.py # OMP JSONL parser
tools/
memory.py # save_memory, search_memory, list_memories, delete_memory
sessions.py # list_sessions, get_session, search_sessions, refresh_sessions
Startup contract (v0.3.0)
This is a hard contract. Breaking it causes MCP clients (Claude Code, Codex, VS Code) to silently miss the server's tools on startup, the bug that motivated v0.3.0.
Rule: lifespan MUST yield in <500ms on every cold boot. Anything that blocks longer than that goes in a background task started after yield.
What this means in practice:
server.py:lifespandoes onlyinit_db()+ReadinessState.new()+init_readiness(state)+asyncio.create_task(_background_startup(...))before yielding. Do not add anything else pre-yield.- The embedding model is never loaded pre-yield. The background startup task warm-starts it (
readiness.warm_start_semantic) right after the initial scan, so it's usually ready before the user's first prompt. If a semantic call races the warm-start,ensure_semantic_ready()loads the model on demand — but it must never wait for scan or backfill completion; semantic queries search whatever vectors exist and backfill catches up in the background. Blocking on backfill is what caused the 30s MCP client timeouts fixed in v0.5.0. save_memoryusesreadiness.get_embedder_if_ready()— opportunistic embedding only. It never triggers a cold load. Backfill embeds any rows saved before the model was up.- The initial session scan runs in a background task, not in lifespan. Tools work as soon as MCP is ready.
- All scan/backfill work runs in worker threads via
asyncio.to_thread. SQLite connections are thread-bound, so worker threads always open their own connection viainit_db(). Never pass the lifespan connection intoto_thread. - Scan + backfill are serialised via
state.maintenance_lockto prevent concurrent writers and to keep semantic results consistent. embeddings.pydoes not importfastembedat module top. The import lives insideEmbedder.__init__. Probe availability withimportlib.util.find_spec("fastembed")instead.
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.
- 2mo ago First seen · 179 lines · 2,200 tokens per session scan A 7765c99da56a
memory_mcp CLAUDE.md is an instructions file published in the GitHub repository nerdyaustin/memory_mcp (1 stars, last pushed 3mo ago), licensed MIT. It adds 2,200 tokens to every session, about $0.0088 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
memory_mcp CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| memory_mcp CLAUDE.mdnerdyaustin/memory_mcp | Instructions file | 1 | 3mo ago | MIT | A | 2,200 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |