session-timeline — скилл для Claude Code: что делает и как установить
Строит хронологическую шкалу событий сессии Claude Code по данным Agent Monitor и считает длительность работы инструментов.
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill session-timeline -a claude-codeЧто делает session-timeline
Скилл восстанавливает пошаговую историю одной сессии Claude Code. На вход он принимает конкретный идентификатор сессии либо ключевые слова latest или last. Данные запрашиваются из локального API Agent Monitor через эндпоинты GET /api/sessions/:id и GET /api/events.
В отчёте формируется Markdown-таблица с колонками offset, event_type, tool_name, duration и summary. Скилл связывает события PreToolUse с последующими PostToolUse для расчёта времени работы каждого инструмента, а также отмечает ошибки APIError, сжатия контекста Compaction, завершение субагентов и паузы более 30 секунд. Если закрывающее событие отсутствует, вызов помечается как unclosed.
Для работы скилла необходим запущенный дашборд Agent Monitor: если локальный сервер недоступен, его требуется поднять командой npm start в корне репозитория монитора. В финале отчёта выводятся суммарное время работы инструментов относительно общей длительности сессии и самый долгий вызов.
Какие задачи решает
- Разобрать по шагам цепочку событий и ошибок конкретной сессии Claude Code
- Найти самый долгий вызов инструмента и вычислить суммарное время выполнения
- Зафиксировать моменты сжатия контекста и простои более 30 секунд
Примеры запросов агенту
- Покажи таймлайн последней сессии latest через session-timeline
- Построй хронологию событий сессии 4a8b1c с длительностью вызовов
Как установить session-timeline
1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill session-timeline -a claude-code2Вручную: положить файлы
~/.claude/skills/session-timeline/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/session-timeline/
1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill session-timeline -a codex2Вручную: положить файлы
.agents/skills/session-timeline/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill session-timeline -a cursor2Вручную: положить файлы
.cursor/skills/session-timeline/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install hoangsonww/Claude-Code-Agent-Monitor session-timeline2Вручную: положить файлы
.github/skills/session-timeline/SKILL.md1Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill session-timeline -a gemini-cli2Командой платформы
gemini skills install https://github.com/hoangsonww/Claude-Code-Agent-Monitor --path plugins/ccam-sessions/skills/session-timelineВручную: положить файлы
.devin/skills/session-timeline/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill session-timeline -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о session-timeline
Как установить session-timeline в Claude Code?
Выполните команду npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill session-timeline -a claude-code.
Что делает скилл session-timeline?
Он запрашивает события сессии у Agent Monitor, вычисляет длительность каждого инструмента и выводит Markdown-таблицу с временными смещениями, ошибками и точками сжатия контекста.
Что делать, если скилл не может получить данные сессии?
Если API дашборда недоступен, запустите локальный сервер Agent Monitor командой npm start из корня его репозитория.
Исходный текст
SKILL.md · MIT
--- name: session-timeline description: > Render an ordered timeline of one Claude Code session's events (every event type) with per-event durations and tool names, reconstructed from Agent Monitor data. Pairs PreToolUse with PostToolUse to compute tool durations and surfaces gaps, errors, and compaction points. Use when reconstructing what happened in a session step by step. --- # Session Timeline Reconstruct the chronological event timeline of a single Claude Code session. ## Input The user provides: **$ARGUMENTS** - A **session ID** to time-line, or - "latest" / "last" for the most recent session. ## Data Sources | Endpoint | Returns | |----------|---------| | `GET /api/sessions/:id` | session header: status, model, cwd, started_at, ended_at, cost, metadata (thinking_blocks, turn_count, total_turn_duration_ms) — and nested events | | `GET /api/events?session_id=X` | the full event stream: event_type (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, Notification, Compaction, APIError, TurnDuration), tool_name, summary, data, timestamp | ## Report Sections ### 1. Resolve & header If "latest", `GET /api/sessions?limit=1` to get the id, then `GET /api/sessions/:id`. Print a one-line header: id, status, model, cwd basename, started_at → ended_at, turn_count, total_turn_duration_ms, cost. ### 2. Build the ordered timeline `GET /api/events?session_id=X`. Sort strictly by `timestamp`. For each event emit a row with: relative offset from `started_at` (e.g. `+00:03.412`), event_type, tool_name (when present), and a one-line `summary`. ### 3. Compute durations Pair each `PreToolUse` with its matching `PostToolUse` (same tool_name, next occurrence) and show the tool's wall-clock duration. For `TurnDuration` events use the recorded duration directly. Flag any `PreToolUse` with no matching `PostToolUse` as **unclosed**. ### 4. Annotate notable points Mark `APIError` (❌), `Compaction` (⚠️ context compressed), `SubagentStop` (subagent finished), `Notification` (ℹ️), and any timeline gap > 30s between consecutive events as an idle window. ### 5. Tallies Event count by type, total tool time vs. session wall time, and the longest single tool call. ## Output A Markdown table — `offset | event_type | tool_name | duration | summary` — in strict timestamp order, preceded by the header line and followed by the tallies. Durations in ms or `mm:ss.mmm`; currency as USD to 4 decimal places. Never invent a duration when a PostToolUse is missing — label it `unclosed`. 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