Prompt file imported from commonfabric/labs (
.claude/commands/logs.md). Fill in{{arguments}}before use. Copyright stays with the author.
the logs of past sessions in this repository are stored in ~/.claude/projects/ under the pwd of this project. determine the correct folder, then list the jsonl files within.
Log Analysis Strategy
-
Use ripgrep (rg) for fast searching across all log files. The folder name is the project's absolute path with
/and.each replaced by-:rg "pattern" ~/.claude/projects/$(pwd | tr '/.' '--')/*.jsonl -
Log file structure: Each line is a JSON object with:
message.content: Main content (string or array of objects)type: "user" or "assistant"timestamp: ISO timestampuuid: Unique message IDparentUuid: Links to previous message
-
Effective search patterns:
- For keywords:
rg -i "keyword1|keyword2" logs/*.jsonl - For conversation flow: Use
jqto follow parentUuid chains - For time ranges:
rg "2025-07-21" logs/*.jsonl - For tool usage:
rg "tool_use.*ToolName" logs/*.jsonl
- For keywords:
-
Find distraction patterns:
- Look for TodoWrite usage showing task switches
- Search for "interrupt", "Request interrupted", or scope changes
- Find where assistant mentions getting confused or changing direction
- Check for long Task tool usage that might indicate research tangents
-
Analyze conversation flow:
- Sample log format first with
head -2 file.jsonl | jq . - Use
jqto extract message content:jq '.message.content' file.jsonl - Look for thinking content:
jq 'select(.message.content[0].type == "thinking")' file.jsonl
- Sample log format first with
-
Common analysis queries:
# Find all TodoWrite usage rg "TodoWrite" logs/*.jsonl | head -10 # Find task interruptions rg "interrupt|distract|confused|forgot" logs/*.jsonl # Find specific feature work rg "cf-render|cf-message-beads" logs/*.jsonl # Extract conversation summary jq -r '.message.content | if type == "string" then . else .[0].text // "" end' file.jsonl | head -20
The user has asked you to search for: {{arguments}}