smc — Search My Claude
Surgical search through Claude Code conversation logs. Built in Rust for speed.
Claude Code stores every conversation as JSONL files — messages, tool calls, thinking blocks, timestamps, git context — but provides no way to search through them after context compaction. smc fixes that.
Search 2.8GB+ of conversation history in under a second.
Quick Start
# Install from crates.io
# Or build from source
Commands at a Glance
| Command | Alias | Description |
|---|---|---|
smc search <query> |
s |
Full-text search across all conversations |
smc sessions |
ls |
List sessions with previews |
smc show <id> |
— | Pretty-print a conversation |
smc tools <id> |
t |
List tool calls in a session |
smc export <id> |
e |
Export session as markdown |
smc context <id> <line> |
ctx |
Show messages around a line number |
smc projects |
p |
List projects with stats |
smc recent |
r |
Latest messages across all sessions |
smc freq [mode] |
f |
Frequency analysis (chars, words, tools, roles) |
smc stats |
— | Aggregate statistics |
Session IDs support prefix matching — type just enough to be unique (e.g., smc show 394af).
Search
The core feature. Parallel full-text search across every message, tool call, tool result, and thinking block.
Output Modes
Browse & Inspect
# List sessions (most recent first)
# View a conversation
# Drill into search results
# See what tools were used
# Export for sharing
Analytics
Stats & Projects
Frequency Analysis
Modes can be abbreviated: chars/c, words/w, tools/t, roles/r.
Tool Usage Frequency
════════════════════════════════════════════════════════════
Bash 16,052 ( 28.5%) ██████████████████████████████
Read 13,526 ( 24.1%) █████████████████████████
Edit 11,794 ( 21.0%) ██████████████████████
Grep 5,492 ( 9.8%) ██████████
Write 2,950 ( 5.2%) █████
...
────────────────────────────────────────────────────────────
56,241 total tool calls
Global Options
How It Works
Claude Code stores conversation logs as JSONL files in ~/.claude/projects/. Each project gets a directory, and each session is a .jsonl file containing one JSON record per line:
| Record Type | Contents |
|---|---|
user |
Your messages |
assistant |
Claude's responses — text, thinking blocks, tool calls |
system |
System prompts and context |
file-history-snapshot |
File state snapshots |
progress |
Progress indicators |
smc uses Rayon for parallel file processing — all CPU cores scan simultaneously, which is why it searches gigabytes in under a second.
Performance
Benchmarked on Apple Silicon, 207 sessions, 2.8GB total:
| Operation | Time |
|---|---|
search (full scan) |
~0.5s |
freq chars (2B+ characters) |
~2s |
stats |
instant |
show |
instant to ~1s |
Development
Requires Rust 1.70+.
Version Management
Why?
Claude Code logs everything — every message, tool call, thinking block, timestamp, git branch — as structured JSONL. But after context compaction, that history is gone. The only way to recover it was manually grepping through files that can be hundreds of megabytes.
smc gives Claude (and you) instant access to all of it.
License
MIT