I’ve accumulated hundreds of Claude Code sessions and kept losing track of where I solved specific problems. The built-in /resume shows recent sessions, but anything older than a few days? Gone.

So I built CCS (Claude Code Search) to fix that.

TLDR Link to heading

brew install agentic-utils/tap/ccs
ccs

Type to search, Enter to resume. That’s it.

The problem Link to heading

Claude Code stores conversations in ~/.claude/projects/ as JSONL files. Each session gets its own file:

{"type":"user","cwd":"/path/to/project","message":{"content":"fix the auth bug"},"timestamp":"2024-01-15T10:00:00Z"}
{"type":"assistant","message":{"content":"I'll help you fix that..."},"timestamp":"2024-01-15T10:01:00Z"}

I was grepping through them manually which was painful. I wanted something like fzf but for my Claude history.

How it works Link to heading

CCS parses all your conversation files in parallel (20 goroutines), shows one row per session sorted by most recent activity, and lets you search across everything you’ve said.

One row per conversation - Each conversation appears once with columns for DATE, PROJECT, TOPIC, MSGS (message count), and HITS (messages matching your search). The display shows clean columns while searching across all message content.

Smart preview - The preview shows:

  • First 2 messages (how the conversation started)
  • Last 2 messages (most recent context)
  • All messages matching your search query with timestamps
  • Gaps collapsed with “… N messages …”

Search terms get highlighted in yellow.

Sorted by recency - Results stay in timestamp order. When searching history, recency usually matters more than match score.

When you select a conversation, it resumes in the original working directory. You can also pass flags through to Claude Code using --, e.g. ccs -- --dangerously-skip-permissions if you like to live dangerously (excellent article, worth the read).

Why Go? Link to heading

Go gives me a single binary with no runtime dependencies and fast startup - important for CLI tools. Easy to cross-compile for Homebrew too.

The TUI is built with bubbletea - a lovely framework for terminal apps. No external dependencies, just a single binary.

Built with Claude Code Link to heading

The entire thing was written in Claude Code sessions. I’d describe what I wanted, test it, refine. Features like the smart preview with gap collapsing and the parallel parsing all emerged from this back-and-forth.

The irony of using Claude Code to build a Claude Code search tool isn’t lost on me. Even this blog post was drafted in a Claude Code session.

It’s ~800 lines of Go. Nothing fancy, but it solves my problem.

  • GitHub
  • brew install agentic-utils/tap/ccs

MIT licensed. Contributions welcome.