Skip to content
Conduit

mcp server

RepoMem

Persistent memory for AI coding agents — SQLite + FTS5, zero dependencies, zero API keys

SUDARSHANCHAUDHARI/RepoMemcommunitylistedunreviewed

Set up

Runs on your computer. Pick your agent and operating system.

Before you start

  • uv (`curl -LsSf https://astral.sh/uv/install.sh | sh`)
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "repomem": {
      "command": "uvx",
      "args": [
        "repomem"
      ]
    }
  }
}

same format Cursor, GitHub Copilot CLI, Junie, JetBrains AI Assistant, Augment (Auggie CLI), Factory Droid, Kiro, Devin CLI +12

Values in angle brackets are placeholders. Restart Claude Desktop after editing its config.Claude Desktop docs

README

synced Oct 25, 2026

RepoMem

Tests Python 3.11+ License: MIT Zero dependencies PRs Welcome

Persistent memory for AI coding agents.
Pure Python · SQLite + FTS5 · Zero dependencies · Zero API keys · Zero telemetry · MIT


Your AI coding assistant forgets everything when the session ends.
RepoMem gives it a brain — one that remembers across sessions, across projects, across months.


Table of Contents

What it does

Every time a Claude Code session ends, RepoMem:

  1. Extracts structured observations from the session (bugs fixed, decisions made, errors seen)
  2. Stores them in a local SQLite + FTS5 database at ~/.repomem/memory.db
  3. At the next session start, injects relevant context back as a Claude system message

The result: Claude arrives knowing what broke last time, what decisions were made, and what's still pending — without you having to repeat yourself.


Installation

git clone https://github.com/SUDARSHANCHAUDHARI/RepoMem
cd RepoMem && bash install.sh

Restart Claude Code. Done.

Also available on PyPI: pip install repomem installs the package but you still need bash install.sh to wire Claude Code hooks, MCP server, and cron jobs.

Requirements: Python 3.11+ · No other dependencies (stdlib only)

Optional semantic search — for embedding-based retrieval that matches meaning over keywords, install the extra: pip install repomem[semantic], then add --semantic to any repomem search. This is fully opt-in; the default install stays zero-dependency and FTS5 is always the fallback.

install.sh handles everything automatically:

StepWhat happens
Python detectionFinds Python 3.11/3.12/3.13 automatically
Package installCopies package to ~/.repomem/lib/
Hook wiringRegisters Stop + SessionStart hooks in Claude Code settings
MCP serverRegisters MCP server in Claude Code settings
Skill installInstalls /repomem skill to ~/.claude/skills/repomem/
Cron jobsAdds nightly reflection + weekly defrag
Health checkVerifies DB is initialized and healthy

Quick start

repomem status                                    # DB stats
repomem doctor                                    # health check
repomem search "null pointer crash"               # search memory
repomem search "database migration" --project my-app
repomem pending                                   # open tasks
repomem decisions                                 # architectural decisions
repomem server                                    # web UI → http://localhost:39000
repomem tui                                       # full-screen terminal UI
repomem graphify                                  # god nodes for current repo
repomem obsidian                                  # export to Obsidian vault
repomem obsidian --no-wikilinks                   # export without wikilinks
repomem import-chat ~/Downloads/session.md        # import old chat export
repomem import-chat ~/Downloads/session.md --move # import + delete source
repomem resolve-error 3                           # mark error #3 resolved
repomem merge-branch feat/my-feature --pr-number 42
repomem sync --export                             # export for cross-machine sync

Claude Code skill — /repomem

RepoMem ships a native Claude Code skill at skills/repomem/. Once installed, type /repomem in any Claude Code session to get a full memory interface without touching the CLI.

Install the skill:

install.sh handles this automatically. If you need to reinstall manually:

mkdir -p ~/.claude/skills/repomem
cp skills/repomem/SKILL.md ~/.claude/skills/repomem/

Triggers:

You typeWhat happens
/repomemStatus + recent observations for current project
"save this to memory"Saves current context as an observation
"what did we fix before?"Searches memory for past bugfixes
"add pending task"Adds a task to the pending queue
"show decisions"Lists architectural decisions
"open web UI"Starts repomem server → http://localhost:39000
"sync memory"Runs repomem sync --export

The skill is Claude Code-only — it uses Claude Code's SKILL.md format. The underlying RepoMem tool is AI-agnostic and works with any agent that can run CLI commands.


Architecture

┌─────────────────────────────────────────────────────────────┐
│                      Claude Code session                      │
└────────────────┬───────────────────────────┬────────────────┘
                 │ session ends               │ session starts
                 ▼                            ▼
        ┌──────────────┐             ┌──────────────────┐
        │  Stop hook   │             │ SessionStart hook │
        │ capture.py   │             │   inject.py       │
        └──────┬───────┘             └────────┬─────────┘
               │ write                         │ read + rank
               ▼                               ▼
        ┌──────────────────────────────────────────────┐
        │           ~/.repomem/memory.db               │
        │  SQLite + FTS5 · 11 tables · local only      │
        └──────┬───────────────────────────────────────┘
               │
    ┌──────────┼──────────────┐
    ▼          ▼              ▼
 reflect.py  defrag.py    MCP server
 (2am daily) (Sun 3am)  (mid-session)

What happens at session end:

StepDetail
Extract observationsRegex patterns detect bugfix/decision/upgrade/warning/learning/error/pending
Tag topicsKeywords match build, networking, database, compose, etc. — short keywords use word-boundary matching to prevent false positives
Link entitiesPascalCase classes, known libraries, filenames extracted and linked
Detect errorsException/Crash/FAILED patterns captured with root cause + fix
Detect releasesreleased v1.2.0, uploaded AAB, TestFlight build, git tag v, versionName, bumped to patterns
Track branchgit branch --show-current saved per project
StoreAll written to SQLite with FTS5 triggers for instant search

What gets injected at session start (priority order):

PriorityContentCap
1Global + project architectural decisionsup to 20
2Open pending tasks for this projectup to 5
3Recent observations ranked by recency × confidenceup to 10
4Conflict warnings (contradicting decisions)up to 4
5Release age warning (if >90 days since last release)1 line
6Cross-project patterns (seen in 2+ projects)up to 3
7Graphify god nodes (high-blast-radius files)up to 5
8Hot entities (most frequently touched classes/files, ≥3 mentions)up to 3
9Unresolved errors with fixesup to 3
—Hard cap: ≤2000 characters total—

MCP tools

When an MCP client connects to RepoMem's server, 8 tools become available mid-session:

ToolArgumentsWhat it does
repomem_searchquery, project?, type?, limit?FTS5 full-text search across all observations
repomem_answerquestion, project?, limit?Grounded, #id-cited memory block to answer from — no LLM call
repomem_savetype, summary, detail?, topic?, project?Persist an observation immediately
repomem_contextproject?Full project context (decisions + pending + recent obs)
repomem_pendingproject?List all open tasks
repomem_decisionsscope?Architectural decisions (global or project-scoped)
repomem_add_pendingtask, project?, priority?Add a pending task to the queue
repomem_resolveidMark a pending task as resolved

Observation types

RepoMem captures 8 structured types automatically from session text:

TypeTrigger phrasesWhat gets stored
bugfix"fixed crash", "resolved issue", "repaired bug"What was broken + how it was fixed
decision"decided to use", "switched to", "migrated to"The choice made and why
upgrade"upgraded to", "bumped version", "updated"Library/tool and new version
warning"watch out", "never", "avoid", "caution"The thing to remember not to do
learning"learned", "discovered", "found out", "note:"New knowledge gained
pending"todo", "next:", "still need", "needs to"Work left for next session
patternAuto-promoted from obs seen in 3+ projectsReusable solution across codebases
errorException / Crash / FAILED / fatalError text + root cause + fix

Interfaces

CLI — 22 commands

CommandDescription
repomem search <q>FTS5 full-text search, optional --project, --type, --limit, --semantic
repomem answer <q>Grounded, #id-cited memory block for a question (no LLM call)
repomem mcp-config -c <client>Print MCP config snippet for claude/cursor/windsurf/cline/codex
repomem addManually add an observation (--type, --summary, --detail)
repomem pendingList open tasks, optional --project
repomem add-pending <task>Add a task with --priority P1/P2/P3
repomem resolve <id>Mark a pending task resolved
repomem resolve-error <id>Mark a tracked error as resolved
repomem decisionsList architectural decisions
repomem add-decisionRecord a decision with --topic, --scope, --reason
repomem statusDB stats: obs count, sessions, projects, DB size
repomem doctorHealth: FTS5 sync, conflicts, unresolved errors, orphans
repomem entitiesList extracted entities; --name to find obs by entity
repomem releasesList auto-detected releases
repomem branchesList tracked open branches
repomem merge-branch <branch>Mark a branch as merged (--pr-number, --pr-url)
repomem import-chat <file.md>Import a raw Claude session export into memory (--project, --move)
repomem sync--export to git chunk, --import to merge peers
repomem obsidianExport to Obsidian vault (--project, --vault, --no-wikilinks)
repomem graphifyGod nodes for current repo, --threshold edges
repomem tuiFull-screen terminal UI
repomem serverStart web viewer, default port 39000

Web viewer

repomem server    # → http://localhost:39000
PageContent
DashboardStats overview + recent observations + unresolved errors
ObservationsBrowsable list with type badge, project, date
DecisionsAll decisions by scope (global / project)
PendingTask queue sorted by priority (P1 → P3)
ErrorsUnresolved errors, recurrence count, known fix
ProjectsAll projects, observation count, last activity date
SearchFull-text search across all observations

Dark mode · No build step · Press / to focus search from any page

Terminal UI

repomem tui
KeyAction
j / ↓Move cursor down
k / ↑Move cursor up
EnterOpen detail view
/Enter search mode
EscExit search
oSwitch to Observations
pSwitch to Pending
dSwitch to Decisions
eSwitch to Errors
rRefresh data
qQuit

Background automation

JobScheduleWhat it does
reflect.py2am dailyDedup near-identical obs (80% similarity), promote cross-project patterns (3+ projects), flag contradictions, apply confidence decay (90d, <0.5 confidence)
defrag.pySunday 3amMerge dupes (85% similarity), archive stale low-confidence obs, trim oversized detail to 2000 chars, rebuild FTS5 index, vacuum DB

Schema

11 tables across 4 phases of development (plus 1 FTS5 virtual table with 4 internal shadow tables managed by SQLite):

TablePhaseKey columns
sessions1id, project, folder, repo_path, started_at, ended_at, obs_count
observations1type, topic, summary, detail, confidence, seen_count, is_stale, conflict_id
observations_fts1FTS5 virtual table (auto-synced via INSERT/UPDATE/DELETE triggers)
decisions1scope (ALL / project), topic, decision, reason, is_superseded
pending1project, task, priority (P1/P2/P3), resolved_at
patterns1topic, title, solution, seen_in (projects), seen_count
entities2name, type (class/file/library/god_node), mention_count
entity_links2entity_id ↔ obs_id many-to-many join
errors2error_text, root_cause, fix, recurred, is_resolved
releases3project, version_name, version_code, released_at, store
branches3project, branch, status (open/merged), pr_number, merged_at

See SCHEMA.md for full column-level documentation.


Configuration

Environment variableDefaultPurpose
REPOMEM_DIR~/.repomemOverride storage location
REPOMEM_INSTALL~/.repomem/libOverride package path (used by hooks)
REPOMEM_PROJECTauto (git remote)Override project name detection
REPOMEM_OBSIDIAN_VAULT~/.repomem/exports/obsidianOverride Obsidian vault export path
REPOMEM_PORT39000Web viewer port

Privacy

GuaranteeDetail
Local onlyAll data in ~/.repomem/memory.db — never leaves your machine
No networkZero outbound connections, ever
No telemetryNo usage data, no crash reports, nothing
No API keysNo OpenAI, Anthropic, or any external service needed
Private tags<private>…</private> content stripped before storage
RelocatableREPOMEM_DIR=/your/path moves the entire database

vs. Alternatives

Short summary — see COMPARISON.md for 5 detailed comparison tables:

claude-memEngramBasic Memorymem0RepoMem
Zero dependencies❌ npm+Bun❌ Go binary❌ uv+Python❌ pip+LLM API✅ stdlib only
Zero API keys✅✅✅❌ needs LLM✅
One-command install✅ npx✅ brew✅ uv❌✅ bash
Stop hook (auto-capture)✅✅❌❌✅
SessionStart auto-injection✅✅❌❌✅
Structured typed observationsPartial✅✅ categorical❌✅ 8 types
Per-project filtering✅✅✅❌✅
Sleep-time reflection❌❌❌❌✅ nightly
Conflict detection❌Beta (needs LLM)❌❌✅ autonomous
Error tracking❌❌❌❌✅
MCP server✅ 4 tools✅ 19 tools✅❌✅ 8 tools
Web viewer (local, no signup)✅ local❌ cloud only❌ cloud only❌✅ local
Terminal UI❌✅Partial❌✅
Obsidian sync❌Beta✅❌✅
Git cross-machine sync❌✅Manual❌✅
DB schema migrations❌❌ confirmed✅ Alembic❌✅
Private content tagging✅ <private>❌❌❌✅ <private>
Fully auditable (no binary)❌ compiled JS❌ Go binary✅✅✅
LicenseApache 2MITAGPLApache 2MIT

memanto — the closest philosophical opposite

memanto (Moorcheh AI, paper) is a research-backed competitor worth contrasting directly, because it makes the opposite design bet at almost every turn.

memantoRepoMem
RetrievalSemantic — proprietary Moorcheh engineLexical — SQLite FTS5
Zero dependencies❌ Docker + Ollama (local) or cloud✅ stdlib only
Zero API keysLocal only (cloud needs key)✅ always
Memory modelQueryable — "not injectable" by designAuto-injected at SessionStart
answer (grounded QA)✅ LLM-generated✅ agent-grounded, no LLM call
Typed observations✅ 13 categories✅ 8 dev-focused types
Conflict detection✅✅
Document ingestion✅ pdf/docx/xlsx/csvMarkdown session import only
Research + benchmarks✅ LongMemEval 89.8%, LoCoMo 87.1%❌
Fully auditablePartial — Moorcheh engine is proprietary✅ read every line
LicenseMITMIT

The honest tradeoff. memanto wins on retrieval quality: its information-theoretic engine matches "the auth thing" to "OAuth token refresh" where FTS5 needs shared keywords. It also has a paper and benchmark numbers RepoMem can't claim. RepoMem wins on footprint and trust: nothing to run — no Docker daemon, no Ollama model pull, no engine you can't read. Just python3 and a SQLite file, fully air-gapped. memanto is built to be asked; RepoMem is built to show up automatically at session start. Pick the bet that fits how you work.

Cells above are drawn from memanto's README and paper, not from running it — a few of its capabilities (Stop-hook capture, per-project scoping, MCP specifics) were left out rather than guessed.


FAQ

Does it work with agents other than Claude Code?
The core tool is AI-agnostic — any agent that can run bash commands can use the CLI. The MCP server works with any MCP-compatible agent (Cursor, Gemini CLI, etc.). The /repomem skill and automatic Stop/SessionStart hooks are Claude Code-specific. Without Claude Code, use the CLI to add observations manually. See INSTALL.md.

Does it slow down session start?
No. The SessionStart hook has a 10-second timeout and injects ≤2000 characters. In practice it runs in under 1 second on a warm DB.

What happens if the DB is corrupted or missing?
All hooks exit 0 and fail silently — a missing or broken DB never blocks a Claude Code session. Run repomem doctor to diagnose and bash install.sh to reinitialize.

How do I stop it capturing something sensitive?
Wrap it in <private>…</private> in your session text. RepoMem strips that content before writing to the DB. Alternatively, set REPOMEM_PROJECT=skip to disable capture for a session entirely.

Can I use it across multiple machines?
Yes. repomem sync --export writes a JSON chunk to ~/.repomem/sync/ and commits via git. On another machine, repomem sync --import merges peer chunks. A watermark ensures only new observations are exported each run.

How do I update?

cd ~/path/to/RepoMem && git pull && bash install.sh

install.sh is idempotent — skips already-wired hooks and MCP entries, and runs DB schema migrations automatically.


Contributing

Contributions are welcome! Please read CONTRIBUTING.md before opening a PR.


Changelog

See CHANGELOG.md for the full history.


License

MIT — see LICENSE for details.


Acknowledgements

RepoMem was built by studying the work of others. Full credit where it's due:

ProjectAuthor / OrgWhat RepoMem borrowed
claude-memthedotmack<private> content tagging, progressive disclosure injection strategy, Stop + SessionStart hook wiring pattern
EngramGentleman-ProgrammingSQLite + FTS5 as the right storage backend for developer memory, MCP server design, session lifecycle (start/end) tooling
Basic Memorybasicmachines-coSleep-time reflection concept (nightly background processing), per-project scoping, archive-never-delete philosophy
basic-memory-skillsbasicmachines-coMemory skill design patterns, wikilink-based cross-referencing, schema validation approach
agentmemoryjayzengInjection priority ordering, hard 2000-char context cap, scratchpad-as-highest-priority pattern, graceful degradation on hook failure
Letta / MemGPTletta-aiTiered memory model (hot/cold), sleep-time compute concept, intentional write pattern
CogneetopoteretesKnowledge graph integration concept — led directly to the graphify integration in Phase 4
ZepgetzepTemporal reasoning: age-labelled observations ("3mo ago"), recency × confidence ranking
mem0mem0aiADD-only accumulation model (never overwrite), entity linking design, temporal decay concept
claude-code-memory-setuplucasrosatiVault-aware wikilink strategy (scan real notes, code-block-safe, first-occurrence-only, longest-match-first), SHORT_KEYWORDS word-boundary fix for topic detection, import-chat pipeline concept, dynamic Obsidian frontmatter tags, processed: timestamp field

See COMPARISON.md for a full breakdown of all tools studied.


About

I'm Sudarshan Chaudhari, a Senior Quality Engineer, Test Automation specialist, and AI systems builder based in Bangkok, Thailand.

I have 13+ years of experience in software quality engineering, working across SaaS, fintech, gaming, web, mobile, cloud, and digital signage platforms. My background combines hands-on test automation with QA leadership, test strategy, CI/CD, release quality, production investigation, and cross-platform validation.

Alongside my professional QA career, I run SudarshanTechLabs, my independent engineering and product lab where I design, build, test, and ship software across Android, web, AI, cybersecurity, developer tooling, and cross-platform applications.

What I work on

  • ⚙️ Quality Engineering & Test Automation — Playwright, Selenium, Cypress, Appium, API testing, automation frameworks, end-to-end testing, CI/CD, release gates, GitHub Actions, risk-based testing, and production validation
  • 🤖 AI Systems & Automation — AI agents, multi-agent orchestration, MCP servers, AI-assisted QA, prompt tooling, developer workflows, automation systems, and Claude Code plugins
  • 📱 Mobile & Cross-Platform Applications — Android applications built with Kotlin and Jetpack Compose, Google Play releases, automated build and publishing pipelines, and cross-platform development spanning iOS, web, Windows, and macOS
  • 🌐 Web Applications & Platforms — Full-stack applications using Next.js, TypeScript, Firebase, Cloudflare, REST APIs, and modern web infrastructure
  • 🛠️ Developer Tooling & CLI Engineering — Rust, Python, TypeScript, CLI utilities, multi-repository tooling, build automation, release tooling, and engineering productivity systems
  • 🛡️ Cybersecurity & Observability — Threat detection, log analysis, security auditing, vulnerability assessment, monitoring, and security-focused developer tools
  • 📺 Digital Signage & Device Platforms — Content validation, playback testing, device compatibility, production investigation, monitoring, and QA across diverse hardware and operating-system environments

My work sits at the intersection of quality engineering, automation, AI, and software development. I approach products with a QA mindset from the beginning: understanding failure modes, designing for testability, automating repetitive work, and building release confidence into the engineering process.

Through SudarshanTechLabs, I also build products and tools from idea to production, covering architecture, development, testing, CI/CD, release automation, monitoring, and ongoing maintenance.

🌐 sudarshantechlabs.com · 💼 LinkedIn · 🐙 GitHub · ✉️ sunny.sudarshan@gmail.com

↑↓ navigate openesc close