ssgrep
Search AI coding-session transcripts without an LLM, a hosted service, or a daemon.
Explore the Documentation »
Table of Contents
About
Your coding-agent transcripts contain problems you already solved, but ordinary text search is poor at finding a solution when you remember the idea rather than the exact words. ssgrep turns the prompt/response episodes in those transcripts into a local search index.
- One global index — Discovers transcripts from every supported coding agent on the machine and reconciles them into a single local LanceDB database
- Semantic search — Late-interaction ColBERT embeddings with native MaxSim scoring; searches work on paraphrases, not just exact words
- Fully local and offline — After a one-time model download, indexing, search, and the MCP server run without network access
- Agent-ready —
ssgrep initinstalls an ssgrep skill into each agent harness, and an MCP server exposes read-only search to any MCP client
Requires macOS or Linux (Windows is not supported) and Python 3.11+.
ssgrep init
ssgrep search "how did I handle async migration failures"
ssgrep show <ref>
Quick Start
Install
Try it without installing (fetched from PyPI and cached):
uvx ssgrep --version
Install globally with uv (recommended):
uv tool install ssgrep
ssgrep --version
Or with pip:
pip install ssgrep
Upgrade with uv tool upgrade ssgrep; remove with uv tool uninstall ssgrep.
Use with Your Coding Agent
One command sets everything up — it registers the ssgrep mcp server with every supported client (Claude Code, Cursor, Zed, Codex CLI, opencode, omp), installs an ssgrep skill into each agent harness, and builds the global index:
ssgrep init
Prefer to register only the MCP clients, or skip one?
ssgrep mcp install # every supported client
ssgrep mcp install cursor zed # a subset
Or register a client manually (per-client snippets in docs/mcp-setup.md):
claude mcp add --scope user ssgrep -- ssgrep mcp
That's all an MCP user has to do. On startup the server discovers every supported coding agent on the machine and builds the global index itself (the first run downloads the ColBERT embedding model from Hugging Face; after that everything is offline). It reconciles new transcripts on every start, so the index stays current without manual commands. Then just ask your agent to search — e.g. "search my sessions for how I fixed the flaky migration test".
The installed ssgrep skill teaches the agent to search before solving, open hits with show, and capture durable lessons with note (see docs/agent-guidance.md).
Use from the Terminal
The CLI searches the same index the MCP server maintains:
ssgrep search "how do I handle async errors"
# Inspect one result using the ref printed by search
ssgrep show <ref>
# Inspect index counts, archive state, and runtime census
ssgrep status
To keep the index fresh when working only from the terminal, run ssgrep index to reconcile new or changed transcripts.
Usage
Run ssgrep --help or ssgrep <command> --help for the installed CLI's authoritative option list.
| Command | Purpose |
|---|---|
ssgrep init |
One-time setup: install agent skills, then index |
ssgrep index |
Build or update the global index |
ssgrep search <QUERY> |
Find relevant episodes |
ssgrep show <REF> |
Inspect one episode's prompt and response |
ssgrep status |
Inspect index counts and database state |
ssgrep note |
Add a durable searchable note |
ssgrep prune |
Permanently delete archived content |
ssgrep mcp |
Start the MCP stdio server |
ssgrep rules |
Print the operating rules installed by init |
Search is global by default; narrow it with --where predicates:
ssgrep search "retry policy" --where "project = '/absolute/path/to/app'"
ssgrep search "tool failure" --where "is_subagent = true AND content_type = 'response'"
Data-oriented commands accept a global --json flag. A transcript that is no longer discovered stays searchable but is marked source_status = 'absent'; restrict to live sources with --where "source_status = 'available'" and clean up archived content with ssgrep prune.
After the first ssgrep init, run ssgrep index any time to reconcile new or changed transcripts into the global index.
See docs/usage.md for the full command reference, --where predicate fields, exit codes, JSON envelopes, and archive semantics.
Supported Agents
ssgrep ingests sessions from every coding agent it can find on the machine, through one adapter per runtime. Each adapter reads only the runtime's own on-disk transcript data and normalizes it into one shared episode schema.
| Runtime | Transcript source | Default location |
|---|---|---|
| Claude Code | native record-pair JSONL | ~/.claude/projects |
| OpenCode | local SQLite store | ~/.local/share/opencode/opencode.db |
| Codex | rollout session JSONL | ~/.codex/sessions |
| Pi | session JSONL | ~/.pi/agent/sessions |
| Prime Agent | session JSONL + session-artifacts/ |
~/.prime/agent/sessions |
ssgrep status reports the runtime census (Runtimes: claude=12, opencode=3, ...), and every search can be narrowed with --where "runtime = 'pi'".
ssgrep init installs an idempotent ssgrep skill into each runtime's own global skills directory. The installed rules tell agents to search before solving, read hits with show, and capture durable lessons with note — see docs/agent-guidance.md.
See docs/runtimes.md for per-runtime ingestion details, environment overrides, and model/device configuration.
MCP
ssgrep mcp starts a read-only MCP stdio server (search_sessions, show_session, index_status) over the same global database the CLI uses. It builds and refreshes the index automatically on startup, for every client — see Quick Start for registration.
ssgrep mcp install registers every supported client (Claude Code, Cursor, Zed, Codex CLI, opencode) in one step; manual snippets and full tool details are in docs/mcp-setup.md.
Privacy
- Transcripts stay local. Indexing and search run on your machine; transcript content is not sent to an LLM or hosted retrieval service.
- Runtime is offline after the model is cached. The first model download uses Hugging Face; warm loads are cache-first, and update checks and pipeline usage telemetry are disabled by default (override with
COCOINDEX_DISABLE_USAGE_TRACKING=0if you want cocoindex's own telemetry back). - Transcript history is read-only. ssgrep never writes to any agent's transcript files;
notewrites only to ssgrep's own application-data directory. - No network listener or daemon. CLI commands are ordinary local processes; MCP uses the client's stdio transport.
The index contains copies of transcript text in the application-data root (created with mode 0700). Protect and back up that directory accordingly.
Docs
docs/usage.md— full command reference, predicate fields, exit codes, JSON output, archive semanticsdocs/runtimes.md— per-runtime ingestion, environment overrides, model and device configurationdocs/retrieval.md— chunking, embedding, scoring pipeline, measured benchmark resultsdocs/agent-guidance.md— the ssgrep operating rules installed into agent harnessesdocs/mcp-setup.md— MCP client configuration and tool detailsdocs/architecture.md— discovery, reconciliation, schemas, and service-layer details
🚀 Credits
- Multi-vector search was significantly improved by @thememium.
License
MIT License. See LICENSE.
Metadata
Release files for ssgrep 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ssgrep-2.0.1.tar.gz | 127.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ssgrep-2.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 289.5 kB
Release files / ssgrep-2.0.1.tar.gz
| Download URL | ssgrep-2.0.1.tar.gz |
|---|---|
| Size | 127.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
50918e200ccd88500a8cff83daf9382577ba2beb55ec23b7ff766e4c893d6093
|
|
BLAKE2b-256 checksum How to use checksums |
b05f41b7fb64cebee20875ca4cd2aa9c26c35387162104a8e514407f951c2fc2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ssgrep-2.0.1-py3-none-any.whl
| Download URL | ssgrep-2.0.1-py3-none-any.whl |
|---|---|
| Size | 162.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4faff47ad33ca15f8f9d0e0a4298e0c132fd964aad5d5554ba913b39b8619f64
|
|
BLAKE2b-256 checksum How to use checksums |
0f7f35a3e21abef9dbc85ae3d36343ee912b8e12fd5907ad6d1f728b91e4c960
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|