event-trace — Claude Code skill: session event timeline
Turns one Claude session into an ordered timeline of its events, flagging gaps, failures and tool calls that never finished.
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill event-trace -a claude-codeWhat event-trace does
Give the skill a session id and it pulls that session's history from the Agent Monitor dashboard. Passing latest or last makes it resolve the newest session on its own, while errors points it at the most recent one with status error. Three endpoints feed the report: GET /api/sessions?limit=N, GET /api/sessions/:id and GET /api/events?session_id=X.
The result is a markdown table with one row per event: index, time, delta from the previous event, event type, tool name and a short summary. A second block carries the annotations — a wait longer than 30 seconds between events, a PreToolUse with no matching PostToolUse, errors from APIError, compaction, and a missing SessionStart at the head or Stop/SessionEnd at the tail. The report closes with a one-line verdict: clean, gaps detected, or failures present.
The dashboard has to be running. Without it the skill has nothing to read and will tell you to start it with npm start from the repo root. Costs appear in USD with four decimals.
What it helps with
- walk through what a session actually did, step by step
- find a tool call that started but never completed
- spot a pause longer than 30 seconds in agent activity
- read an API error message next to the events around it
- check whether session start and end events went missing
Example prompts for the agent
- Trace the event timeline for session
latest - Break down session
errorsand show where it failed - Build an event report for session
abc123with gap annotations
How to install event-trace
1Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill event-trace -a claude-code2Manually: put the files in place
~/.claude/skills/event-trace/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/event-trace/
1Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill event-trace -a codex2Manually: put the files in place
.agents/skills/event-trace/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill event-trace -a cursor2Manually: put the files in place
.cursor/skills/event-trace/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install hoangsonww/Claude-Code-Agent-Monitor event-trace2Manually: put the files in place
.github/skills/event-trace/SKILL.md1Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill event-trace -a gemini-cli2Platform CLI
gemini skills install https://github.com/hoangsonww/Claude-Code-Agent-Monitor --path plugins/ccam-devtools/skills/event-traceManually: put the files in place
.devin/skills/event-trace/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill event-trace -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about event-trace
How do I install event-trace in Claude Code?
Run npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill event-trace -a claude-code. The skill file lands at ~/.claude/skills/event-trace/SKILL.md.
What does event-trace do?
It builds a chronological timeline of every event in a single Claude session and marks gaps, unpaired tool calls, errors and compactions.
What does event-trace need to run?
A running Agent Monitor dashboard, since the skill reads its /api/sessions and /api/events endpoints. If the dashboard is unreachable, start it with npm start from the repo root.
Source text
SKILL.md · MIT
--- name: event-trace description: > Trace the full event chain for one Claude Code session into an ordered timeline of every event type with tool_name and summary, highlighting gaps, out-of-order events, and failures. Reads /api/events?session_id= and /api/sessions/:id from the Agent Monitor dashboard. Use when debugging what a session actually did, step by step. --- # Event Trace Build a chronological, annotated event timeline for a single session. ## Input The user provides: **$ARGUMENTS** This is a session ID. It may also be: - `latest` / `last` — trace the most recently updated session - `errors` — trace the most recent session whose status is `error` ## Data Sources | Endpoint | Returns | |----------|---------| | `GET /api/sessions?limit=N` | session list (used to resolve `latest`/`errors` and the target id) | | `GET /api/sessions/:id` | full session detail (status, model, cwd, started_at, ended_at, cost, nested agents + events) | | `GET /api/events?session_id=X` | the ordered event stream: event_type, tool_name, summary, data, timestamp | ## Report Sections ### 1. Resolve the session If `$ARGUMENTS` is a raw id, use it. If `latest`/`last`, call `GET /api/sessions?limit=1`. If `errors`, call `GET /api/sessions?limit=10&status=error` and pick the newest. Confirm the id resolves via `GET /api/sessions/:id`; if not, report it as missing and stop. ### 2. Session header From `GET /api/sessions/:id`: id, status, model, cwd, started_at → ended_at, total duration, cost (USD to 4 decimals), and counts (events, agents). ### 3. Ordered timeline From `GET /api/events?session_id=X`, list every event in timestamp order. One row per event: `| # | time | Δ since prev | event_type | tool_name | summary |` Cover all event types present: SessionStart, PreToolUse, PostToolUse, Stop, SubagentStop, Compaction, APIError, TurnDuration, Notification, SessionEnd. ### 4. Gap & failure highlights Annotate the timeline: - **Gaps**: any Δ > 30s between consecutive events — mark ⏳ and note the wait. - **Unpaired tool calls**: a PreToolUse with no matching PostToolUse (same tool_name, next in stream) — mark ⚠️ "no completion recorded". - **Failures**: APIError events and PostToolUse whose `summary`/`data` indicates an error — mark ❌ with the error text. - **Compaction**: mark ♻️ and note it resets the visible token baseline. - **Missing bookends**: no SessionStart at the head or no Stop/SessionEnd at the tail of an ended session — mark 🚩. ### 5. Verdict One line: CLEAN, GAPS DETECTED, or FAILURES PRESENT — with the count of each flag type and the single most likely thing to investigate next. ## Output - Markdown timeline table, events in strict timestamp order. - Status glyphs inline: ✅ ok, ❌ error, ⚠️ warning/unpaired, ⏳ gap, ♻️ compaction, 🚩 missing bookend. - Currency in USD to 4 decimals. - Cite only event data returned by the API — do not invent timestamps or summaries. - If the dashboard is unreachable, tell the user to start it with `npm start` from the repo root.
© hoangsonww · MIT · hoangsonww/Claude-Code-Agent-Monitor