| name | mala-logs |
| description | Search and analyze mala orchestrator and Claude session logs. Use when searching for session logs, debugging agent runs, finding tool errors, analyzing mala run history, or investigating issue-specific logs. Triggers on queries like "find logs for issue X", "what went wrong in the last run", "show tool errors", "list recent sessions". |
Mala & Claude Log Analysis
Quick Reference
| Log Type | Location | Format |
|---|
| Claude sessions | ~/.claude/projects/{encoded-path}/*.jsonl | JSONL (raw) |
| Claude sessions | ~/.claude/projects/{encoded-path}/*.html | HTML (rendered) |
| Mala runs | ~/.config/mala/runs/{encoded-path}/*.json | JSON |
Path encoding: /home/user/repo → -home-user-repo
Note: .jsonl files contain raw conversation data for programmatic analysis. .html files are rendered views for human reading.
Helper Scripts
Scripts are in this skill's scripts/ directory. Run with full path or from skill dir.
find-logs.py
python find-logs.py sessions --repo /path/to/repo --recent 10
python find-logs.py runs --repo . --recent 5
python find-logs.py session <session-uuid> --repo .
python find-logs.py issue <issue-id> --repo .
python find-logs.py search "pytest.*failed" --repo . --recent 5
parse-session.py
python parse-session.py /path/to/session.jsonl --summary
python parse-session.py session.jsonl --tools
python parse-session.py session.jsonl --tools --filter Bash
python parse-session.py session.jsonl --tools --filter Bash --limit 5
python parse-session.py session.jsonl --errors
python parse-session.py session.jsonl --text
Direct CLI Patterns
Quick log discovery
ls -lt ~/.claude/projects/-home-cyou-mala/*.jsonl | head -10
xdg-open ~/.claude/projects/-home-cyou-mala/session-*.html
Search within logs
grep '"is_error": true' session.jsonl
grep '"name": "Bash"' session.jsonl
grep -E 'Exit code [1-9]' session.jsonl
grep -E 'git commit' session.jsonl
Parse with jq
jq -c 'select(.type=="assistant") | .message.content[]? | select(.type=="tool_use") | {name, input}' session.jsonl
jq -c 'select(.message.content) | .message.content[]? | select(.type=="tool_result" and .is_error==true) | {tool_use_id, content}' session.jsonl
Issue → Log Path Workflow
python find-logs.py issue mala-51q.1 --repo .
python parse-session.py /path/from/step1.jsonl --summary
python parse-session.py /path/from/step1.jsonl --errors
See references/log-schema.md for complete schema documentation.