tail-events — Claude Code command: what it does, how to install
tail-events fetches recent events from a local Agent Monitor dashboard and displays them in a compact table. Useful for tracking agent tool calls and session state.
MIT ★ 1,198 updated 2026-10-23
/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor
/plugin install ccam-devtools@claude-code-agent-monitor-pluginsWhat tail-events does
The command queries http://localhost:4820/api/events via curl and parses JSON output with jq. It requests 20 events by default, but accepts an optional count parameter N.
Output renders as a compact aligned table with timestamp, event type, and tool name. Monitored events cover PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, Notification, Compaction, APIError, and TurnDuration. Toolless events show a dash in place of the tool name.
The command is strictly read-only. Without an active Agent Monitor server on port 4820, execution fails: if the API returns a non-200 status or an empty body, start the dashboard by running npm start from its repository root.
What it helps with
- inspect recent agent tool calls directly in terminal
- detect session issues like APIError and context Compaction
- check event timestamps and active tools without opening a browser
Example prompts for the agent
- /tail-events
- /tail-events 50
- Show the last 10 agent events using /tail-events 10
How to install tail-events
1Plugin marketplace
/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor/plugin install ccam-devtools@claude-code-agent-monitor-plugins2Manually: put the files in place
.claude/commands/tail-events.mdCall it with /tail-events. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/tail-events.mdCall it with /prompts:tail-events. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/tail-events.prompt.mdManually: put the files in place
.gemini/commands/tail-events.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about tail-events
How to install tail-events in Claude Code?
Run /plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor, then /plugin install ccam-devtools@claude-code-agent-monitor-plugins. You can also place the command file directly at .claude/commands/tail-events.md.
What does tail-events do?
It fetches the latest events from the local Agent Monitor API and prints an aligned table containing timestamps, event types, and tool names.
What is required to run tail-events?
It requires the Agent Monitor service running locally on port 4820. If the API call fails or returns empty data, run npm start in the dashboard repository root.
Source text
tail-events.md · MIT
---
description: Show the latest N ingested events with timestamp, event_type, and tool_name.
argument-hint: "[N]"
---
Show the most recent events from the Agent Monitor dashboard. Argument:
**$ARGUMENTS** — `N`, the number of events to show (default 20).
Fetch recent events and take the newest N:
```bash
N="${1:-20}"
curl -s "http://localhost:4820/api/events?limit=${N}" | jq -r '.[] | "\(.timestamp)\t\(.event_type)\t\(.tool_name // "-")"'
```
The `/api/events` list is returned newest-first; show the most recent `N`.
Render a compact, aligned table — one row per event:
```
TIME EVENT_TYPE TOOL_NAME
2026-06-25T14:03:11Z PostToolUse Bash
2026-06-25T14:03:09Z PreToolUse Bash
2026-06-25T14:02:58Z Stop -
```
Include `event_type` (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart,
SessionEnd, Notification, Compaction, APIError, TurnDuration) and `tool_name`
when present (use `-` for events without a tool). End with a one-line count:
`Showing latest <N> events.`
If the request returns a non-200 or empty body, say so and tell the user to start
the dashboard with `npm start` from the repo root. Read-only — never POST or
modify events.
© Son Nguyen · MIT · hoangsonww/Claude-Code-Agent-Monitor