Local semantic search over Claude Code conversation history
Project description
claude-code-search
Local semantic search over your Claude Code conversations. Find past sessions by meaning, get the ID, resume them.
$ ccsearch "scheduler bug"
1. 0.39 2026-04-10 airflow 940abfde-... (754 msgs)
Investigate concurrency bugs in Airflow scheduler
• Debugged scheduler re-queueing bug
• Traced it to DAG parse retry loop
↳ Scheduler hasn't picked up the task yet...
cd ~/workspace/airflow && claude -r 940abfde-...
Install + setup
pip install claude-code-search # or: pipx install / uv tool install
ccsearch init # indexes, sets up daily auto-refresh, detects ollama
That's it. init walks you through everything:
claude-code-search setup
[1/3] Indexing your conversations...
found 937 files; 937 need indexing
done in 5m12s: 937 files, 50999 chunks, 303 sessions.
[2/3] Setting up daily auto-index...
installed: runs daily at 02:00
[3/3] Conversation outlines (optional, requires ollama)...
ollama found, model gemma2:9b available.
starting background summarizer (303 conversations to process)...
Ready. Try: ccsearch "what was I working on last week"
No ollama? No problem — everything works without it. You just won't get bullet outlines in results.
Usage
ccsearch "your query" # semantic search (~3s)
ccsearch -g "#64827" # exact text search (~0.2s, no model)
ccsearch show <id> --query "text" # view messages around a match
ccsearch resume <id> # cd + claude -r, back in the conversation
ccsearch stats # index health
--compact for one-line-per-result, --json for scripting, -n 20 for more results.
Configuration
ccsearch config # see current settings
ccsearch config --edit # open in $EDITOR
Key settings in config.toml (auto-generated, all have sensible defaults):
| Setting | Default | What |
|---|---|---|
[embedding] model |
BAAI/bge-small-en-v1.5 |
Embedding model (~130 MB) |
[embedding] device |
auto |
auto-detects mps/cuda/cpu |
[summarization] model |
gemma2:9b |
Ollama model for outlines |
[search] top_n |
10 |
Results per query |
[schedule] hour |
2 |
Daily auto-index hour |
Swap embedding model: edit config, run ccsearch index --rebuild.
Swap summary model: edit config, ollama pull <model>, run ccsearch summarize --daemon.
Commands
ccsearch init setup everything (run once)
ccsearch "query" semantic search
ccsearch -g "text" literal grep search (instant)
ccsearch show ID [--query Q] view conversation context
ccsearch resume ID resume in Claude Code
ccsearch summarize --daemon/--stop background outlines via ollama
ccsearch schedule --install/--uninstall daily auto-index
ccsearch config [--edit] view/edit settings
ccsearch stats index health
ccsearch --help full help
How it works
Parses .jsonl from ~/.claude/projects/ → chunks messages → embeds with sentence-transformers → stores in SQLite + sqlite-vec → KNN search grouped by session. Grep mode (-g) skips all of that and does LIKE '%query%' directly on the chunks table.
Tradeoffs
Good at: finding conversations by topic, exact ID lookup (-g), resuming past work, staying fully local.
Limitations: ~3s startup (torch import), English-biased embeddings, sqlite-vec caps KNN at k=4096 (fine for ~50K chunks), ollama needed for outlines only. macOS + Linux tested; Windows untested (os.fork in daemon).
License
MIT
Project details
Release history Release notifications | RSS feed
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_code_search-0.2.0.tar.gz.
File metadata
- Download URL: claude_code_search-0.2.0.tar.gz
- Upload date:
- Size: 34.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc33eba59895119ac00740c0e41c602e0219b11ed0c7a69fa33b93bf433d0594
|
|
| MD5 |
70d8695599d37f52cb2aa3fb4bc2c9cc
|
|
| BLAKE2b-256 |
a3c470dc2513c0a5a87a137a85164d865da9bbdae29be17735dbf74a0cfbf125
|
File details
Details for the file claude_code_search-0.2.0-py3-none-any.whl.
File metadata
- Download URL: claude_code_search-0.2.0-py3-none-any.whl
- Upload date:
- Size: 32.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9738d68277b238d426be6ce6b7bc1c51bdfe5d970d08f25378cf3bb1b4a48e3
|
|
| MD5 |
217ec330b89e5964c25ce0339d944f71
|
|
| BLAKE2b-256 |
fed48a0b2b67347e0c12cb05bc1cefd8bdf10087a9dcf56286c9d06c9575b4bf
|