context-memory

Persistent, searchable context storage across Claude Code sessions using SQLite + FTS5.
Table of Contents
Why?
Claude Code sessions are ephemeral - every conversation starts from zero. Close the terminal and everything you discussed, decided, and solved is gone. The only way to get that context back is to re-explain it or hope Claude reads the right files.
context-memory fixes this.
- "How did we fix that auth bug last week?" - Instead of re-debugging,
/recall authentication pulls up exactly what you did, what you decided, and why.
- Decisions have context - You chose JWT over sessions for a reason. Three months later, you can't remember why. Your past sessions can.
- Code patterns survive sessions - That elegant retry pattern you built? It's saved with the language, file path, and description of what it does.
/recall retry pattern --detailed brings it back.
- Projects you haven't touched in months -
/recall --project scopes to whatever you're working in. Instant refresher on where you left off.
- Cross-project learning - Solved a CORS issue in one project? When it hits another,
/recall CORS finds it regardless of which project it came from.
- Sub-50ms search - It's SQLite with FTS5 and tuned PRAGMAs (WAL mode, 64MB cache, in-memory temp store). Searching thousands of sessions feels instant.
- Two words to save everything -
/remember and Claude does the rest: summarizes, extracts topics, identifies key code, stores it all. Add a note if you want, or don't.
Without it, every session is a blank slate. With it, Claude Code has a long-term memory that grows more valuable the more you use it.
Features
Core:
- Cross-session memory - Save and recall past work across Claude Code sessions
- Structured AI summaries -
/remember generates rich summaries with brief/detailed text, key decisions, problems solved, technologies used, and outcome classification (success/partial/abandoned)
- Full-text search - FTS5 with Porter stemming for fast, fuzzy search
- Two-tier retrieval - Summary-ranked search with multi-source boost (<10ms) + deep content fetch (<50ms)
- Project-scoped or global - Filter by current project or search everything
- Topic categorization - Auto-extracted topics for browsable history
- Code snippet storage - Preserve important code with language and context
- Outcome tracking - Every session is classified as success, partial, or abandoned — searchable and charted in the dashboard
Hooks:
- Auto-save on exit - Stop hook captures session context automatically when Claude Code exits, with smart head+tail transcript sampling (first 5 + last 10 messages) to preserve the problem statement and resolution
- Git branch capture - Auto-save detects the current git branch and adds it as a topic, so
/recall feature/auth-refactor finds sessions from that branch
- Pre-compact checkpoints - Saves full conversation before context compaction for zero context loss, recoverable via the
context_load_checkpoint MCP tool
- Session deduplication - Auto-save checks for a rich
/remember save in the same project within a configurable window (default 5 minutes) and skips if one exists
- Loop prevention - Auto-save checks
stop_hook_active to prevent recursive hook invocation
Extras:
- Web dashboard - Full SPA with 17 REST API endpoints, dark/light theme, Chart.js analytics, Highlight.js code rendering, session CRUD, and search autocomplete
- MCP server - Six tools for programmatic access from any MCP-compatible client
- CLI tools - All core scripts (
db_save.py, db_search.py, db_prune.py, db_init.py) have full argparse CLIs with --help
- Database pruning - Prune old sessions by age or count, and old checkpoints per session, with dry-run preview