claude-repo-mem
Durable, hierarchical, repo-scoped memory for Claude Code. Local-first MCP server.
claude-repo-mem indexes your repository — code, docs, and your own accumulated decisions — into a SQLite database with hybrid lexical + vector retrieval, then exposes it to Claude Code as 11 MCP tools.
Why claude-repo-mem
Working with an AI agent in a real codebase runs into the same friction every session:
- Context burns fast. Native
Read/Greppull whole files into the window to answer narrow questions.recallreturns ranked, summarized, scoped results inside a token budget — full source for the top hits, summaries for the rest — so you spend context on what matters. - Following code flow is expensive. Chasing a caller → handler → route by hand means repeated reads.
tracewalks the relation graph from a seed and returns the connected source in one round-trip. - Nothing carries across sessions. Decisions, conventions, and the "why" behind the code evaporate when the conversation ends.
remember,handoff, andresumepersist durable memory and task state as git-trackable markdown. - It stays on your machine. Everything lives in a single
.claude-repo-mem/directory with a local embedding model by default — no code leaves the repo, no API key required.
The result: the agent treats your repo as the authoritative source for its own structure and history, instead of rediscovering it file-by-file each time.
Install
pip install claude-repo-mem
Requires Python 3.11+.
Quick start
cd your-repo
claude-repo-mem index # build the index (downloads bge-small on first run, ~90MB)
claude-repo-mem doctor # verify: units, by_layer, T2 coverage, counters
To expose it to Claude Code, drop a .mcp.json in your repo root:
{
"mcpServers": {
"claude-repo-mem": {
"command": "claude-repo-mem",
"args": ["serve", "--watch"]
}
}
}
Claude Code will auto-launch the server on workspace load. The --watch flag runs an incremental file watcher (debounced 750ms) so the index stays current as you edit.
No path needed under Claude Code: it injects
CLAUDE_PROJECT_DIRinto the server's environment, which the server uses to locate the index even though MCP servers are launched from a system working directory rather than your repo. Under a different MCP host that doesn't setCLAUDE_PROJECT_DIR, pin the repo with"--root", "/abs/path"or theCLAUDE_REPO_MEM_ROOTenv var. See docs/usage.md.
Prefer not to run the watcher? Install a git hook instead:
claude-repo-mem install-hooks # writes .git/hooks/post-commit
CLI
claude-repo-mem index [--embedder NAME] [--no-embed] [--reset]
claude-repo-mem serve [--watch | --no-watch]
claude-repo-mem doctor # layer counts, T2 coverage, counters
claude-repo-mem install-hooks [--force] # git post-commit reindex
claude-repo-mem distill [--yes] [--transcript PATH] # extract durable memories from a transcript
claude-repo-mem bench --fixture queries.yaml [--k 5] [--no-embed]
Languages and synthesizers
| Language | Parser | Notes |
|---|---|---|
| Python | tree-sitter | classes, methods, functions, docstrings |
| JavaScript / TypeScript | tree-sitter | functions, classes, methods, JSX |
| Java | tree-sitter | classes, interfaces, methods, constructors |
| Go | tree-sitter | funcs, methods, structs, interfaces |
| Rust | tree-sitter | fn, impl methods, structs, traits |
| Markdown | markdown-it | sections by heading hierarchy |
Synthesizers add cross-file edges on top of parser output:
- Flask
@app.route(...)→ handler. - Django
path(...)/re_path(...)→ handler (resolves dotted refs againstviews.py). - Express
app.METHOD(url, handler)→ same-file handler. - Python imports → cross-module edges.
- React hooks —
useStatesetter calls emitmutates_state_ofedges on the containing component.
Documentation
Full documentation lives in docs/:
- Usage guide — indexing, Claude Code setup, configuration, workflows, troubleshooting.
- Tool reference — the 11 MCP tools, their parameters and returns.
- Architecture — how indexing, storage, and retrieval work.
- Contributing — dev setup, tests, and release flow.
License
MIT. See LICENSE.
Release notes for each version live in CHANGELOG.md.
Metadata
Release files for claude-repo-mem 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| claude_repo_mem-0.1.3.tar.gz | 45.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| claude_repo_mem-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 127.4 kB
Release files / claude_repo_mem-0.1.3.tar.gz
| Download URL | claude_repo_mem-0.1.3.tar.gz |
|---|---|
| Size | 45.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
67f911c9a75c4ea7ec9031d951b640739d6cf9916eff6db7a933a7da7f8e5167
|
|
BLAKE2b-256 checksum How to use checksums |
9707f811d093b1e97f8314a6042bdb41a73a57494825dd20173b632f137133e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 30, 2026.
Transparency logRelease files / claude_repo_mem-0.1.3-py3-none-any.whl
| Download URL | claude_repo_mem-0.1.3-py3-none-any.whl |
|---|---|
| Size | 81.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
477c8f8848ac76f9b29d345a8c21bc16da22a7c332565fb176584b6a06b4f361
|
|
BLAKE2b-256 checksum How to use checksums |
7a5cc3eebfc5b86397f99fa6c50a674078d520af70bbddded979d42af3c0a572
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 30, 2026.
Transparency log