Skip to content

0xAnto/srch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

srch

Fast full-text search across your AI coding conversations. Searches Claude Code, Codex, and Cursor session histories locally.

Built in Rust. Trigram index with memory-mapped I/O for sub-millisecond indexed searches. Falls back to parallel full-text scan when no index is available.

Install

cargo build --release
cp target/release/srch ~/.local/bin/

Usage

srch --index                         # build trigram index (run once, re-run to update)
srch "orderbook"                     # search all conversations
srch -r "auth.*token"                # regex search
srch -f user "river effect"          # only your messages
srch -f assistant "implementation"   # only AI responses
srch -t claude "river"               # claude conversations only
srch -t codex "documentation"        # codex conversations only
srch -t cursor "perpetual"           # cursor conversations only
srch -p 3dbook "orderbook"           # filter by project name
srch -l 20 "query"                   # 20 results per page (default 10)
srch --plain "query"                 # non-interactive output (for pipes)

Options

    --index              Build/rebuild the trigram search index
-r, --regex              Treat query as regex pattern
-f, --from <FROM>        Filter by sender: user, assistant, all, both [default: both]
-t, --tool <TOOL>        Filter by tool: claude, codex, cursor (default: all)
-p, --project <PROJECT>  Filter by project name (substring match)
-l, --limit <LIMIT>      Page size for results [default: 10]
    --plain              Plain output (no interactive mode)

Indexing

Run srch --index to build a trigram index at ~/.cache/srch/trigram.idx. This is a flat binary file designed for memory-mapped access — no deserialization overhead on query.

srch --index             # builds index (~5s for 250 sessions, ~37 MB)
srch "query"             # uses index automatically (sub-ms for most queries)

The index stores pre-lowercased text with a trigram lookup table for O(candidates) search instead of O(all entries). If the index is stale (source files modified after index), srch falls back to live search automatically. Re-run --index to update.

Interactive Mode

Default when running in a terminal. Arrow keys to navigate, Enter to open full conversation context, q to quit.

  ▸ claude:3dbook • 2026-03-15 16:59 • YOU
    ...can we move the left or right based on the mid price to create a river effect?

    codex:docs • 2026-03-25 09:50 • CODEX
    Build and maintain documentation sites with Mintlify.

Found 17 matches across 31 projects (251 sessions in 0ms)
↑↓ navigate • Enter open • q quit

Conversation View

Press Enter on any result to see the full conversation around that message. Scroll with arrow keys, q to go back.

Data Sources

Tool Location Sessions
Claude Code ~/.claude/projects/**/*.jsonl per-project
Codex ~/.codex/sessions/**/*.jsonl date-based
Cursor ~/.cursor/projects/*/agent-transcripts/**/*.jsonl per-project

Sender Colors

  • YOU (green) — your messages
  • CLAUDE (blue) — Claude responses
  • CODEX (magenta) — Codex responses
  • CURSOR (cyan) — Cursor responses
  • TOOL (yellow) — tool calls (visible with -f all)

About

Fast full-text search across Claude Code, Codex, and Cursor conversations. Trigram-indexed, memory-mapped, sub-millisecond queries. Built in Rust.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages