// Search and analyze Claude Code conversation history. Use when user asks about past conversations, previous solutions, what was discussed earlier, finding something from history, or analyzing usage patterns. Triggers include "what did we discuss", "find that conversation", "search history", "past sessions", "how much time", "token usage", "which tools".
| name | claude-history |
| description | Search and analyze Claude Code conversation history. Use when user asks about past conversations, previous solutions, what was discussed earlier, finding something from history, or analyzing usage patterns. Triggers include "what did we discuss", "find that conversation", "search history", "past sessions", "how much time", "token usage", "which tools". |
| allowed-tools | Bash, Read, Grep, Glob |
mkdir -p ~/.claude/skills
cp claude-history SKILL.md ~/.claude/skills/
chmod +x ~/.claude/skills/claude-history
Once installed, Claude Code will automatically use this skill when you ask about past conversations, usage patterns, or want to search your history.
Browse, search, and analyze Claude Code conversation history using the claude-history CLI tool.
# Current workspace
claude-history lss
# All sources (local + WSL + Windows + remotes)
claude-history lss --ah
# Filter by workspace pattern
claude-history lss myproject
# Filter by date
claude-history lss --since 2025-11-01
claude-history lss --since 2025-11-01 --until 2025-11-30
# Export current workspace sessions
claude-history export
# Export specific workspace
claude-history export myproject
# Export with date filter
claude-history export --since 2025-11-24
# Export minimal (no metadata, cleaner for reading)
claude-history export --minimal
# Export to specific directory
claude-history export -o /tmp/history-export
# Summary dashboard
claude-history stats
# Time tracking (work hours per day)
claude-history stats --time
# Tool usage breakdown
claude-history stats --tools
# Model usage
claude-history stats --models
# Daily trends
claude-history stats --by-day
# Per-workspace breakdown
claude-history stats --by-workspace
# All local workspaces
claude-history lsw
# Filter by pattern
claude-history lsw myproject
Claude Code stores conversations in ~/.claude/projects/ as JSONL files:
{uuid}.jsonlagent-{id}.jsonlWorkspace directories are encoded paths (e.g., -home-user-myproject = /home/user/myproject).
Since the tool doesn't have a search command, use this workflow:
# Export recent sessions from ALL workspaces to temp directory
claude-history export --aw --since 2025-11-24 -o /tmp/history-search --minimal
# Search the exported markdown files
grep -r -i "search term" /tmp/history-search/
# Find the workspace directory
ls ~/.claude/projects/ | grep myproject
# Search within JSONL files (content is in message.content)
grep -i "search term" ~/.claude/projects/-home-user-myproject/*.jsonl
For questions like "what did we discuss about database connections":
Example for "database connections":
# Export recent history from all workspaces first
claude-history export --aw --since 2025-11-24 -o /tmp/search --minimal
# Search for related terms
grep -r -i -l "database" /tmp/search/
grep -r -i -l "connection" /tmp/search/
grep -r -i -l "postgres\|mysql\|sqlite\|mongo" /tmp/search/
grep -r -i -l "sql" /tmp/search/
grep -r -i -l "pool\|timeout" /tmp/search/
Then read the matching files to find relevant conversations.
Export recent sessions from all workspaces:
claude-history export --aw --since 2025-11-24 -o /tmp/history --minimal
Search for the topic and variations:
grep -r -i -l "TOPIC" /tmp/history/
grep -r -i -l "RELATED_TERM1" /tmp/history/
grep -r -i -l "RELATED_TERM2" /tmp/history/
Read matching files to summarize findings
Search for error-related terms:
claude-history export --aw --since 2025-11-01 -o /tmp/history --minimal
grep -r -i "error\|exception\|failed" /tmp/history/ | head -50
Look for solution patterns:
grep -r -i -A5 "fixed\|resolved\|solution" /tmp/history/
claude-history stats --time
claude-history stats --tools
claude-history stats --by-day --since 2025-11-01
claude-history export --ah --aw -o ~/claude-backup/
--minimal for reading: Omits UUIDs and metadata, much cleaner--since to narrow scope: Faster searches on recent historylsw to see all available workspacesagent-*.jsonl files with sub-conversationsExported markdown includes: