/dev-vitals:agent-session-forensicsfrom dev-vitals
Diagnoses interrupted agent sessions, missing tool results, timing bottlenecks, and subagent trace correlation by inspecting session history files with jq.
Ships in dev-vitals. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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.mdWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub yeaight7/agent-powerups --plugin dev-vitals16 skills in this plugin
/agent-harness-designUse when designing tool definitions for a new agent or subagent, an agent shows high retry rates, ambiguous tool invocations, or silent failures, or an existing agent harness needs a quality review./agent-runtime-patternsUse when optimizing agent runtime loops, card packs, MCP session lifecycle, tool-call count, or multi-agent orchestration patterns./brainstormingUse when starting any creative work — creating features, building components, adding functionality, or modifying behavior — before any implementation begins./context-compressionUse when conversation context is bloated, constraints are being forgotten, or a compact handoff is needed before continuing work./context-minimizationUse when a task runs long and the context window is filling -- large files are being read whole, command output is flooding the transcript, or responses are getting verbose and slow./context-retrieval-loopUse when starting work in an unfamiliar area of a codebase, spawning a subagent that needs targeted file context, a first search pass missed the relevant file, or the file scope of a task is unclear.2 plugins in one repository ship this exact skill · first indexed Jul 28, 2026
Other plugins' skills for the same job