session-logs
Installation
SKILL.md
Session Logs
Overview
Search and analyze your own session logs to find past conversations, track usage, and review costs.
Location
Session data is stored in .codebuddy/sessions/ in the project directory.
Common Queries
List sessions by date
ls -lt .codebuddy/sessions/*.json | head -20
Search across all sessions
rg -l "search term" .codebuddy/sessions/
Extract user messages from a session
jq '.messages[] | select(.role == "user") | .content' .codebuddy/sessions/<session>.json
Extract assistant responses
jq '.messages[] | select(.role == "assistant") | .content' .codebuddy/sessions/<session>.json
Get tool usage breakdown
jq '[.messages[] | select(.role == "assistant") | .tool_calls[]? | .function.name] | group_by(.) | map({tool: .[0], count: length}) | sort_by(-.count)' .codebuddy/sessions/<session>.json
Calculate session cost
jq '.usage.totalCost // "unknown"' .codebuddy/sessions/<session>.json
Find sessions that used a specific tool
for f in .codebuddy/sessions/*.json; do
if jq -e '.messages[] | select(.role == "assistant") | .tool_calls[]? | select(.function.name == "bash")' "$f" > /dev/null 2>&1; then
echo "$f"
fi
done
Tips
- Use
jqfor structured queries on JSON session files - Use
rg(ripgrep) for fast full-text search across all sessions - Combine with
sort,uniq -cfor frequency analysis - Export a session summary: pipe jq output to a markdown file
Related skills
More from phuetz/code-buddy
blender
Blender 3D modeling, animation, and rendering automation via Python bpy scripting and CLI
19figma
Automate Figma design workflows via REST API, Plugin API, and MCP integration
3github
Interact with GitHub using the gh CLI for issues, PRs, CI runs, releases, and API queries
3ableton-live
Ableton Live music production automation via OSC protocol, MIDI, and Max for Live
3gitlab
GitLab DevOps platform with CI/CD pipelines, API automation, and glab CLI control
3blog-watcher
Monitor blogs, RSS/Atom feeds, and websites for updates
3