Settings

Theme

Show HN: Search-sessions – Search all your Claude Code session history in <300ms

github.com

4 points by sinzin91 8 days ago · 4 comments · 2 min read

Reader

Claude Code forgets everything between sessions. After months of heavy use, I had 1.6GB of JSONL session files buried in ~/.claude/projects/. Architecture decisions, debugging breakthroughs, and solutions I couldn't find again. There’s nothing more annoying that solving the same problem twice.

I tried RAG pipelines and local vector DBs, but they added complexity for a problem that's really just text search over structured files. So I built search-sessions: a single Rust binary that searches your session history directly. No database, no indexing step, no dependencies.

It supports two modes: index search (~18ms) for finding the right session, and deep search (~280ms with ripgrep, ~1s without) for matching against full message bodies. Each result includes the session UUID so you can resume any conversation with `claude --resume`.

The design choice that makes it work: skip the database entirely. JSONL files are already structured — just search them fast. Under the hood it's just files and a CLI, so it's easy to inspect, backup, and delete. You install it as a Claude Code skill, then ask "do you remember that auth refactor?" and Claude searches your history and picks up the thread. It also works with OpenClaw.

MIT licensed. macOS and Linux:

brew install sinzin91/tap/search-sessions

or

cargo install search-sessions

Curious what people think about exact vs fuzzy vs semantic search as a default — and which other coding CLIs you’d like supported.

SteveVeilStream 8 days ago

If I am not mistaken, Claude sometimes pulls an API key out of a .env file and drops it into that folder. It might be neat for you to add a feautre specifically for identifying any keys that are in that folder.

  • sinzin91OP 8 days ago

    I have a separate project for that use case, good idea to integrate it here though!

kirilligum 8 days ago

i had the same experience with vector db and ditched them. i like no database approach. do you add something to agents.md or claude.md so that claude code know how to use this tool?

  • sinzin91OP 8 days ago

    I have this in my CLAUDE.md:

      ## Session Memory & Recall                                                                                                                                    
      - When asked to remember, recall, or look up something from past sessions, use the `/search-sessions` skill                                                   
      - Start with index search; if no results, suggest `--deep` for full message content search
      - Use `--project` filter when the context is clearly tied to a specific project

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection