| name | session-logs |
| description | Search and analyze past Claude Code session logs using jq and ripgrep (rg). Find conversations by date, keyword, or topic. Extract decisions, code changes, and key moments from session history. Use when user says "search past sessions", "what did we discuss about X", "find old conversation", or "session history".
|
| allowed-tools | ["Bash","Read","Write"] |
| model | haiku |
| user-invocable | true |
| when_to_use | When user wants to find or review past conversation sessions, search for a previously discussed topic, or analyze session history. Triggers: "search past sessions", "find conversation about", "what did we discuss", "session history", "past logs", "previous conversation", "find when we talked about".
|
| argument-hint | <action: list|search|view|analyze> [query] [--date YYYY-MM-DD] [--limit N] |
Session Logs
Search and analyze past Claude Code session and conversation logs using jq and rg
(ripgrep). No external CLI beyond jq and rg needed.
Prerequisites
brew install jq
sudo apt install jq
brew install ripgrep
sudo apt install ripgrep
jq --version && rg --version
Common Log Locations
| Location | Description |
|---|
~/.claude/ | Claude Code settings and memory |
~/.claude/projects/ | Per-project session data |
workspace/ | Saved session outputs |
memory/ | Agent memory files |
Commands
List recent session files:
ls -lt ~/.claude/projects/ | head -20
Search session logs by keyword:
rg "keyword" ~/.claude/projects/ --type json -l
Search with context lines:
rg -C 3 "keyword" ~/.claude/projects/ --type json
Search memory files:
rg "topic" memory/ -l
rg -i "topic" memory/learned-today.md
Parse JSONL session file:
cat <session-file.jsonl> | jq -r
<session-file.jsonl> | jq -r
<session-file.jsonl> | jq -r