Durable, hierarchical, repo-scoped memory for Claude Code. Local-first MCP server with hybrid lexical + vector retrieval over your codebase, docs, and accumulated decisions.
Project description
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_repo_mem-0.1.3.tar.gz.
File metadata
- Download URL: claude_repo_mem-0.1.3.tar.gz
- Upload date:
- Size: 45.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67f911c9a75c4ea7ec9031d951b640739d6cf9916eff6db7a933a7da7f8e5167
|
|
| MD5 |
9e218c969a0876337c2a8e8b9008f278
|
|
| BLAKE2b-256 |
9707f811d093b1e97f8314a6042bdb41a73a57494825dd20173b632f137133e9
|
Provenance
The following attestation bundles were made for claude_repo_mem-0.1.3.tar.gz:
Publisher:
python-publish.yml on amritmalla/claude-repo-mem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_repo_mem-0.1.3.tar.gz -
Subject digest:
67f911c9a75c4ea7ec9031d951b640739d6cf9916eff6db7a933a7da7f8e5167 - Sigstore transparency entry: 1674204066
- Sigstore integration time:
-
Permalink:
amritmalla/claude-repo-mem@32286a1d5c60c068a60fbea59ad736cc5378b59d -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/amritmalla
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@32286a1d5c60c068a60fbea59ad736cc5378b59d -
Trigger Event:
release
-
Statement type:
File details
Details for the file claude_repo_mem-0.1.3-py3-none-any.whl.
File metadata
- Download URL: claude_repo_mem-0.1.3-py3-none-any.whl
- Upload date:
- Size: 81.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
477c8f8848ac76f9b29d345a8c21bc16da22a7c332565fb176584b6a06b4f361
|
|
| MD5 |
7c3d4e125e9c67fb3659109c255dbd64
|
|
| BLAKE2b-256 |
7a5cc3eebfc5b86397f99fa6c50a674078d520af70bbddded979d42af3c0a572
|
Provenance
The following attestation bundles were made for claude_repo_mem-0.1.3-py3-none-any.whl:
Publisher:
python-publish.yml on amritmalla/claude-repo-mem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_repo_mem-0.1.3-py3-none-any.whl -
Subject digest:
477c8f8848ac76f9b29d345a8c21bc16da22a7c332565fb176584b6a06b4f361 - Sigstore transparency entry: 1674204124
- Sigstore integration time:
-
Permalink:
amritmalla/claude-repo-mem@32286a1d5c60c068a60fbea59ad736cc5378b59d -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/amritmalla
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@32286a1d5c60c068a60fbea59ad736cc5378b59d -
Trigger Event:
release
-
Statement type: