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.
npx agentmods add instructions/nerdyaustin/memory_mcp/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.svg" alt="Measured on agentmods" 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 | $0.02200 | $0.02200 |
| Opus 5 | $0.01100 | $0.01100 |
| Sonnet 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 3d 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.
- 3d 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 1mo ago), licensed MIT. It adds 2,200 tokens to every session, about $0.0110 per session on Opus 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.
Other instructions, from other repositories
vespertide AGENTS.md
AGENTS.md instructions for dev-five-git/vespertide, covering vespertide knowledge base, structure, where to look, data flow and conventions.
aeon CLAUDE.md
Instructions for aeonfun/aeon, covering aeon, how aeon works, strategy, voice and soul file hierarchy (read in this order).
mcp-structured-memory CLAUDE.md
Claude Code instructions for nmeierpolys/mcp-structured-memory, a project described as: Structured Memory MCP Server.
inkwell-memory CLAUDE.md
Instructions for veronchenko/inkwell-memory, covering claude.md — inkwellmemory, layout, multi-tenant mode (inkwellmultitenant=1), conventions and testing.
RNR-Enhanced-Cognee AGENTS.md
AGENTS.md instructions for vincentspereira/RNR-Enhanced-Cognee, covering rnr enhanced cognee implementation for codex, critical requirements, 1. ascii-only output (no unicode encoding), 2. dynamic categories (no hardcoded categories) and 3. standard memory mcp interface.
memory-mcp-1file AGENTS.md
Instructions for pomazanbohdan/memory-mcp-1file, covering ⛔ l0 invariants (never violate under any circumstance), detection heuristic, 🔀 phase transition routing (⛔ blocking), gate-0: phase identification & loading and 🧾 proof-of-load requirement (critical).