replay · hoangsonww — Claude Code command: what it does, how to install
replay summarizes an Agent Monitor session with costs, turn metrics, and a concise chronological recap of tool actions.
MIT ★ 1,198 updated 2026-10-23
/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor
/plugin install ccam-sessions@claude-code-agent-monitor-pluginsWhat replay does
The command pulls session data from the Agent Monitor local API at http://localhost:4820. When provided with a session identifier, it requests that specific record; if the argument is omitted, it retrieves the newest record using the /api/sessions?limit=1 endpoint.
The summary starts with a single header containing the session status, model, working directory, turn count, duration, and cost in USD rounded to four decimal places. Below that, it builds an ordered list of 5 to 10 points covering user intent, tool executions, failed calls, and the final state while truncating payloads beyond roughly 200 characters.
If the dashboard server is down, the command cannot collect telemetry. It will instruct you to start the monitor by running npm start in the repository root.
What it helps with
- inspect session costs and token spend in USD
- review tool calls and failures without reading raw logs
- recap the latest Claude Code run after completion
- trace the chronology of turns in a monitored session
Example prompts for the agent
- /replay
- /replay sess_12345
- Summarize the latest run using replay
How to install replay
1Plugin marketplace
/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor/plugin install ccam-sessions@claude-code-agent-monitor-plugins2Manually: put the files in place
.claude/commands/replay.mdCall it with /replay. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/replay.mdCall it with /prompts:replay. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/replay.prompt.mdManually: put the files in place
.gemini/commands/replay.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about replay
How to install replay in Claude Code?
Add the marketplace source via /plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor, then install the package with /plugin install ccam-sessions@claude-code-agent-monitor-plugins. Alternatively, place the file at .claude/commands/replay.md.
What does the replay command do?
It queries http://localhost:4820 for metadata and transcripts of tracked runs, then formats an overview containing model details, spend figures, and key steps.
What happens if the Agent Monitor service is offline?
The command alerts you that the dashboard is unreachable and advises running npm start from the repository root to bring up the local API.
Source text
replay.md · MIT
--- description: Summarize one Agent Monitor session by id — header plus a concise transcript recap. argument-hint: "[session-id]" --- Produce a concise recap of one Claude Code session tracked by the Agent Monitor. The session id is **$ARGUMENTS**. If empty, resolve the latest: `curl -s "http://localhost:4820/api/sessions?limit=1"` and use its `id`. Fetch the session header and its transcript: ``` curl -s "http://localhost:4820/api/sessions/$ARGUMENTS" curl -s "http://localhost:4820/api/sessions/$ARGUMENTS/transcript" ``` The first returns the session detail (status, model, cwd, started_at, ended_at, cost, metadata: turn_count, thinking_blocks, total_turn_duration_ms). The second returns the ordered transcript messages (user / assistant / tool). Then print, concisely: 1. **Header** — one block: `id · model · status · cwd basename · turn_count turns · $<cost to 4dp> · <started_at → ended_at>`. 2. **Recap** — 5–10 bullets walking the conversation in order: the user's goal, the key assistant actions and tools used, any tool failures, and how it ended. Summarize each message in one line; do not paste large payloads (truncate past ~200 chars with `…`). Currency as USD to 4 decimal places. If the transcript is empty, say the session has no stored transcript rather than inventing turns. If the dashboard is unreachable, tell the user to start it with `npm start` from the repo root.
© Son Nguyen · MIT · hoangsonww/Claude-Code-Agent-Monitor
Similar slash commands
All slash commands for Agent setup: memory, context, orchestration →replay by other authors comes first.