Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill event-trace -a claude-code
Open on GitHub

What 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 errors and show where it failed
  • Build an event report for session abc123 with gap annotations

How to install event-trace

1Skills CLI (Vercel)

npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill event-trace -a claude-code

2Manually: put the files in place

~/.claude/skills/event-trace/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/event-trace/

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

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set22

remote-collection A skill that walks the agent through CCAM remote data sources: connect machines over SSH and pull Claude and Codex history. Useful when sessions live beyond your laptop. CX Codex +1 ★ 1,121repo stars regression-watch Compares an older baseline window of session history with a recent one and reports which metrics got worse: errors, cache, compactions, cost per session. CX Codex +1 ★ 1,121repo stars benchmark The benchmark skill takes one session or a few recent ones and compares them with the rolling average from Agent Monitor data: cost, tokens, tool count and workflow complexity. Each metric comes back as a percentile of the population. CX Codex +1 ★ 1,121repo stars session-debug Pulls a single Claude session out of Agent Monitor and reports its event chain, subagent tree, token spend and failures. CX Codex +1 ★ 1,121repo stars quick-stats Get a compact Agent Monitor snapshot covering agent sessions, spending, daily events, and tool usage. Check the latest activity from your terminal. CX Codex +1 ★ 1,121repo stars live-watch Polls the Agent Monitor /api/stats endpoint a few times in a row and reports how the counters shift across that window. Useful when you want motion, not a single snapshot. CX Codex +1 ★ 1,121repo stars spend-forecast Turns the daily session trend on the Agent Monitor dashboard into a spend projection for the end of the week or month. CX Codex +1 ★ 1,121repo stars cost-alert Walks through the budget rules configured in Agent Monitor and the alerts that already fired, with a plain explanation of what set each one off. CX Codex +1 ★ 1,121repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor