From dev-vitals
Diagnoses interrupted agent sessions, missing tool results, timing bottlenecks, and subagent trace correlation by inspecting session history files with jq.
How this skill is triggered — by the user, by Claude, or both
Slash command
/dev-vitals:agent-session-forensicsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- Agent session ended mid-tool-call or cannot resume.
jq or equivalent JSON tooling available.Inventory session files — find metadata, current history, rotated previous history, and related subagent histories.
Count and list last turns:
jq 'length' history.json # total messages
jq '.[-10:] | .[] | {role, stop_reason}' history.json # last 10 turns
jq '.[] | select(.role=="assistant") | .tool_calls[].id' history.json # tool call IDs
jq '.[] | select(.role=="user") | .tool_results[]?.tool_call_id' history.json # results
Correlate tool call IDs — every tool_call in an assistant turn must have a matching tool_result in the immediately following user turn. Find the first gap.
Check timing for slow calls:
jq '.[] | select(.timing) | {role, duration_ms: .timing.duration_ms}' history.json
Identify failure pattern — see table below.
Repair (if approved) — write a backup first (cp history.json history.json.bak), then make the smallest possible fix at the last valid correlation boundary.
| Symptom | Likely cause | Repair |
|---|---|---|
| Tool call with no result turn | Session interrupted mid-tool | Truncate after last matched pair |
| Two consecutive user turns | Duplicate message insertion | Remove the duplicate |
tool_result with no prior tool_call | Corrupted or manually edited history | Remove orphan result |
Empty content on assistant turn | Model returned no text + no tools | Usually safe to truncate |
| Session loops without progress | Missing result causes re-prompt | Inject minimal synthetic result |
references/history-diagnostics.mdnpx claudepluginhub yeaight7/agent-powerups --plugin dev-vitalsCreates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.
2plugins reuse this skill
First indexed Jul 28, 2026