Claude-Code-Agent-Monitor session-debug
install
source · Clone the upstream repo
git clone https://github.com/hoangsonww/Claude-Code-Agent-Monitor
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/hoangsonww/Claude-Code-Agent-Monitor "$T" && mkdir -p ~/.claude/skills && cp -r "$T/plugins/ccam-devtools/skills/session-debug" ~/.claude/skills/hoangsonww-claude-code-agent-monitor-session-debug && rm -rf "$T"
manifest:
plugins/ccam-devtools/skills/session-debug/SKILL.mdsource content
Session Debug
Debug and inspect a Claude Code session from Agent Monitor data.
Input
The user provides: $ARGUMENTS
This may be:
- A session ID to debug
- "latest" or "last" for the most recent session
- "errors" to find and debug the most recent errored session
Procedure
-
Identify the target session:
- If session ID given:
fromGET /api/sessions/{id}http://localhost:4820 - If "latest":
(default sort: most recently updated first)GET /api/sessions?limit=1 - If "errors":
GET /api/sessions?limit=10&status=error
- If session ID given:
-
Collect full session data:
- Session metadata: status, model, cwd, timestamps, duration
- Events:
— full event timelineGET /api/events?session_id={session_id} - Agents:
— all agents in sessionGET /api/agents?session_id={session_id} - Cost:
GET /api/pricing/cost/{session_id}
-
Analyze the session:
Session Lifecycle
- Start time → first event → last event → end time
- Status transitions (active → working → completed/error)
- Total duration and active-vs-idle time
Event Chain Analysis
- Chronological event list with timestamps and durations
- Identify the critical path (longest chain of dependent events)
- Flag events that took unusually long
- Highlight error events with full error context
Agent Inspection
- List all agents: type, task, status, duration
- Subagent tree visualization (parent → children)
- Agents that failed and their last known state
- Agent switching patterns (when and why new agents spawned)
Tool Execution Trace
- Every tool invocation in order with: tool name, duration, success/failure
- Failed tool calls with error messages
- Tool retry patterns (same tool called multiple times)
Anomaly Detection
- Events out of expected order
- Gaps in event timeline (>30s with no events)
- Duplicate events or agent states
- Token usage spikes (compaction indicators)
-
Diagnosis:
- Root cause hypothesis (if errors present)
- Contributing factors
- Remediation suggestions
Output Format
Present as a debug report with:
- Session summary header (ID, status, model, duration, cost)
- Color-coded timeline (✅ success, ❌ error, ⚠️ warning, ℹ️ info)
- Agent tree diagram
- Diagnosis section with numbered findings