Recall your Claude Code conversations instantly with semantic search, and synthesize insights automatically from your coding sessions.
- 🔍 Semantic Search: Find relevant conversations using natural language queries
- 📚 Auto-Indexing: Automatically indexes new conversations when Claude Code sessions end
- 🏠 Local & Private: All embeddings and data stay on your machine
- ⚡ Fast: Vector search powered by ChromaDB
- 🎯 Accurate: Uses state-of-the-art sentence-transformers model
- 💬 Slash Command: Search directly within Claude Code using
/search-history
- 🧠 Automated Insights: Automatically captures patterns, decisions, and learnings from conversations
- 📝 Markdown Memory: Stores insights as readable markdown files (no vector DB needed)
- 🔄 Three-Way Synthesis: Auto-synthesis every 20 prompts, AI-suggested at key moments, manual
/synthesizecommand - 📈 Progressive Disclosure: Lightweight index with details on demand
- 🚀 Backfill: Process all historical conversations with Haiku for speed
- Python 3.10+
- uv package manager
curl -LsSf https://astral.sh/uv/install.sh | shgit clone <your-repo-url>
cd cc-recall
chmod +x install.sh
./install.shThis will:
- Install dependencies with
uv - Index your existing chat history
- Install the
/search-historyand/synthesizeslash commands - Configure auto-indexing on session end
- Configure auto-synthesis every 20 prompts
- Create insights directory at
~/.claude/cc-recall/insights/ - Add synthesis reminders to your global
CLAUDE.md
Manual Installation:
git clone <your-repo-url>
cd cc-recall
uv sync
uv run index-sessions
cp commands/search-history.md ~/.claude/commands/
# Then configure the hook in ~/.claude/settings.local.json (see Hook Configuration section)First, do a one-time full index of your existing chat history:
cd ~/cc-recall
uv run index-sessionsThis will:
- Read your chat history from
~/.claude/history.jsonl - Generate embeddings using the sentence-transformer model
- Store vectors in a local ChromaDB database (
./chroma_db)
The SessionEnd hook is already configured in .claude/settings.local.json. It will automatically index new conversations when your Claude Code sessions end.
To verify it's working, check after your next session:
uv run index-sessions --statsFrom Command Line:
uv run search-sessions "how to use git hooks"Inside Claude Code:
/search-history embedding models and vector databases
# Get more results
uv run search-sessions "debugging python" --results 20
# Filter by project
uv run search-sessions "API endpoints" --project "/path/to/project"
# Filter by date
uv run search-sessions "authentication" --date "2025-01-15"
# Get JSON output
uv run search-sessions "docker setup" --json# Find conversations about embeddings
uv run search-sessions "embedding models and vector search"
# Find debugging sessions
uv run search-sessions "fix bug in authentication flow"
# Find setup/configuration topics
uv run search-sessions "environment setup configuration"
# View database statistics
uv run index-sessions --statscc-recall automatically synthesizes insights from your coding sessions into structured markdown files. Unlike raw conversation search, synthesis extracts the meaning behind your work: architectural patterns, decisions, problem-solutions, and learning progressions.
The synthesis system operates on three levels:
-
Automatic (Every 20 Prompts)
- UserPromptSubmit hook tracks your conversation length
- Triggers background synthesis every 20 user prompts
- Non-blocking: runs silently without interrupting your flow
-
AI-Suggested (At Key Moments)
- Claude monitors conversation context via global CLAUDE.md instructions
- Suggests synthesis after: solving problems, making decisions, completing features
- Natural prompts like: "Would you like me to run
/synthesizeto capture these insights?"
-
Manual (User Control)
- Run
/synthesizeanytime within Claude Code - Full control over when to capture insights
- Run
Synthesis extracts meaningful insights, not trivial patterns:
- Architectural Patterns: Code structure preferences, design decisions, consistent approaches across projects
- Problem-Solutions: Recurring issues and their fixes, debugging strategies, what works and what doesn't
- Decisions: Technical choices with rationale, trade-offs accepted, technology selections
- Learning: Concepts being explored, skill progression, current focus areas
Insights are stored as markdown files at ~/.claude/cc-recall/insights/:
~/.claude/cc-recall/insights/
└── index.md # Lightweight summary (loaded first)
- Index: Concise summaries with evidence (occurrences, projects, dates)
- Progressive: Load lightweight index first, details on demand
- No Vector DB: LLMs read markdown natively—no embeddings needed for synthesis
Process all your existing conversation history:
# Automated backfill using Haiku (fast & cheap)
uv run backfill-auto --auto
# Resume from a specific batch if interrupted
uv run backfill-auto --auto --resume 25This processes conversations in batches, extracting insights from your entire coding history.
Trigger synthesis manually within Claude Code:
/synthesize
Claude will:
- Read the last ~50 conversation entries
- Read current insights from
~/.claude/cc-recall/insights/index.md - Extract new patterns, problems, decisions, and learnings
- Merge with existing insights (update, don't replace)
- Update the index with evidence-based entries
Instead of confidence scores, insights show evidence:
- Number of occurrences
- Projects where observed
- Date ranges
- Cross-references to related insights
Example:
### API-First Architecture
- Observed in: video-api, auth-service, data-pipeline (3 projects)
- Last updated: 2025-02-10
- Pattern: Prefer standalone API servers over monoliths
- Evidence: Consistent choice across 8 conversations over 3 months- Parser (
parser.py): Parses~/.claude/history.jsonlinto structured entries - Indexer (
index.py): Generates embeddings and stores in ChromaDB (full re-index) - Incremental Indexer (
incremental_index.py): Adds only new entries since last index - Search (
search.py): Semantic search interface with rich CLI output - SessionEnd Hook (
hooks/session-end-index.sh): Auto-indexes new entries on session exit - Slash Command (
~/.claude/commands/search-history.md): Search from within Claude Code
- Synthesizer (
synthesize.py): Extracts insights from conversation history - Backfill (
backfill.py): Manual batch prompt generator for historical processing - Automated Backfill (
backfill_auto.py): Automated historical processing using Haiku - UserPromptSubmit Hook (
hooks/prompt-counter-synthesize.sh): Auto-synthesis every 20 prompts - Slash Command (
~/.claude/commands/synthesize.md): Manual synthesis trigger - CLAUDE.md Integration: AI suggests synthesis at natural breakpoints
- Embedding Model:
sentence-transformers/all-MiniLM-L6-v2- 384-dimensional embeddings
- Optimized for semantic similarity
- Works well with technical/code content
- Vector Database: ChromaDB
- Local persistent storage
- Fast similarity search
- No external dependencies
- Data Source:
~/.claude/history.jsonl- Claude Code's native chat history format
cc-recall/
├── src/
│ └── claude_memory/
│ ├── __init__.py
│ ├── parser.py # History file parser
│ ├── index.py # Full indexing
│ ├── incremental_index.py # Incremental indexing
│ ├── search.py # Search interface
│ ├── synthesize.py # Insight synthesis
│ ├── backfill.py # Manual batch processing
│ └── backfill_auto.py # Automated backfill with Haiku
├── hooks/
│ ├── session-end-index.sh # Auto-index hook
│ └── prompt-counter-synthesize.sh # Auto-synthesis hook
├── commands/
│ ├── search-history.md # Search slash command
│ └── synthesize.md # Synthesis slash command
├── docs/
│ └── synthesized-insights.md # Design documentation
├── install.sh # One-command installer
├── pyproject.toml # Project configuration
├── README.md
└── .gitignore
Note: Personal insights are stored at ~/.claude/cc-recall/insights/ (not in the repo).
- SessionEnd Hook: When a Claude Code session ends, the
SessionEndhook triggers - Incremental Index: The hook runs
uv run index-new --silentwhich:- Checks the current number of indexed entries
- Parses the history file to get all entries
- Only indexes entries beyond the last indexed count
- No Duplicates: The incremental indexer is idempotent - running it multiple times won't create duplicates
- Silent Mode: Runs silently in the background, doesn't interrupt your workflow
Both hooks are configured in ~/.claude/settings.local.json:
{
"hooks": {
"SessionEnd": [
{
"command": "~/cc-recall/hooks/session-end-index.sh",
"timeout": 30
}
],
"UserPromptSubmit": [
{
"command": "~/cc-recall/hooks/prompt-counter-synthesize.sh",
"timeout": 5
}
]
}
}- SessionEnd: Runs incremental indexing when session ends (blocks for up to 30s)
- UserPromptSubmit: Counts prompts and triggers synthesis every 20 prompts (background, 5s timeout)
uv sync# Test the parser
uv run python -m claude_memory.parser
# View indexing stats
uv run index-sessions --statsThe default model (all-MiniLM-L6-v2) is fast and works well for most cases. You can experiment with other models by modifying the model_name parameter:
BAAI/bge-small-en-v1.5- Better quality, slightly slowersentence-transformers/all-mpnet-base-v2- Higher quality, larger model- Any HuggingFace sentence-transformer model
If you see "Database not found", run the indexer first:
uv run index-sessionsMake sure you have Claude Code installed and have used it at least once. The history file should be at ~/.claude/history.jsonl.
To re-index (e.g., after many new conversations):
uv run index-sessions
# Answer 'y' when prompted to clear and re-indexMIT
Contributions welcome! Please feel free to submit a Pull Request.