How to Monitor Claude Code Agents in Real Time
You can monitor Claude Code agents with built-in commands (/tasks, /usage, a custom status line), with hooks or OpenTelemetry for event streams, or with a local dashboard that reads session transcripts. Built-in views cover one session. To watch every agent across all sessions, you need hooks, telemetry or a tool that tails the transcript files.
This guide compares each option, shows the exact commands and files, and tells you what each one can and cannot show. Monitoring is one part of the Claude Code monitoring hub; for the token side, see how to track and reduce Claude Code token usage.
What you want to see
Most developers who ask "how do I monitor my agents" want the same five things:
- Status: which subagent is running, finished or failed right now.
- Ownership: who handed work to whom (the main session, a subagent, a skill).
- Duration: how long a task has been running.
- Tokens: how many tokens each task and session used.
- Project: which repository or folder the work belongs to.
Pick the method below that gives you those five with the least setup.
Option 1: Built-in views in the session
/tasks and the subagent panel
Running subagents appear in a panel below the prompt input. Run /tasks to list them. Each row shows the model, and the effort level if one is set (Claude Code v2.1.242 or later). Press Enter on a subagent to open its transcript. Completed subagents stay listed for 30 seconds, and failed or stopped ones keep their row for 30 seconds (press x to clear it sooner). Press Ctrl+B to move a running task to the background.
Limit: this is the current session only, and it disappears when you close the terminal.
/usage for tokens and cost
Run /usage and read the Session heading for token usage by model and an estimated dollar figure. On Pro, Max, Ultra, Team and Enterprise plans it also shows an attribution breakdown: usage by skills, subagents, plugins and MCP servers, as a percentage of the total, for the last 24 hours or 7 days (press d or w to switch).
Limit: the figures are approximate, computed from local session history on this machine, and show a point in time, not a live feed.
A custom status line
The status line is a bar at the bottom of Claude Code that runs a script you configure. The script receives JSON on stdin, including cost.total_cost_usd, context_window.used_percentage and transcript_path. The quickest way to set one up is to type /statusline followed by what you want, for example:
/statusline show model name and context percentage with a progress bar
Claude Code writes a script to ~/.claude/ and updates your settings. To set it by hand, add this to ~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "~/.claude/statusline.sh"
}
}
Updates are debounced at 300 ms. Add refreshInterval (minimum 1, in seconds) if the session sits idle while background subagents work.
Limit: one line for one session, and you write the script.
Option 2: Hooks
Hooks run your command (or an HTTP POST) when Claude Code reaches an event. Two events matter for agent monitoring:
SubagentStartfires when Claude spawns or resumes a subagent. Input fields:agent_idandagent_type, plus the common fieldssession_id,transcript_pathandcwd.SubagentStopfires when a subagent finishes responding. It addsagent_id,agent_type,agent_transcript_path,last_assistant_message,background_tasksandsession_crons.
Configure hooks in ~/.claude/settings.json (all projects), .claude/settings.json (one project, shareable) or .claude/settings.local.json (one project, gitignored). The matcher for both events filters on agent type, for example Explore or general-purpose; for a custom subagent it is the name field in the frontmatter, not the filename.
A minimal logger that appends one line per subagent stop might look like this (requires jq):
{
"hooks": {
"SubagentStop": [
{
"hooks": [
{
"type": "command",
"command": "jq -c '{t: now, agent: .agent_type, id: .agent_id}' >> ~/.claude/subagent-log.jsonl"
}
]
}
]
}
}
Note what this logs: only the agent type and id. The payload also contains last_assistant_message, which is message text, so choose fields deliberately before sending a payload to a dashboard.
Limit: you maintain the hook configuration, and each hook is code that runs on your machine. Many community dashboards are built on this mechanism.
Option 3: OpenTelemetry export
Claude Code can export metrics and events to an OTLP collector or Prometheus. Turn it on with environment variables:
export CLAUDE_CODE_ENABLE_TELEMETRY=1
export OTEL_METRICS_EXPORTER=console
export OTEL_METRIC_EXPORT_INTERVAL=1000
The console exporter prints metrics to your terminal for debugging. For a real setup, use otlp with OTEL_EXPORTER_OTLP_ENDPOINT, or prometheus (metrics are scraped at http://localhost:9464/metrics).
Useful metrics include claude_code.session.count, claude_code.token.usage (types input, output, cacheRead, cacheCreation) and claude_code.cost.usage (USD). Metrics can carry agent.name and skill.name attributes, which are redacted to custom or third-party unless OTEL_LOG_TOOL_DETAILS=1.
Content is not logged by default. Prompts stay redacted unless you set OTEL_LOG_USER_PROMPTS=1.
Limit: you need a collector and a place to chart the data (Grafana or similar). It is built for organizations and observability stacks, not for a quick look.
Option 4: Read the transcripts yourself
Every session writes a JSONL transcript under ~/.claude/projects/. Subagents write their own:
~/.claude/projects/{project}/{sessionId}/subagents/agent-{agentId}.jsonl
Each has a matching agent-{agentId}.meta.json. Transcripts are deleted after cleanupPeriodDays (30 days by default). On Windows, ~ is your user folder, for example C:\Users\<you>.
To follow one live from a macOS or Linux terminal:
tail -f ~/.claude/projects/<project>/<sessionId>/subagents/agent-<agentId>.jsonl
Limit: raw JSON lines contain message text and are hard to read at a glance. This is the data source for most local dashboards, not a monitor by itself.
Option 5: A local dashboard that reads transcripts
A transcript-based dashboard turns those files into a live view without any hook setup. Agent Office is one example: a free, local Node.js service that tails the transcripts and shows your agents and skills as staff in an isometric pixel-art office. Other community tools take different approaches; see the dashboard comparison.
What Agent Office shows
- Office view: a campus map with a room per department. When a handoff starts, a character walks from the lobby to the target department and sits at a desk while it works. Hover a character to see its task, project, who assigned it, elapsed time, task tokens and a short "Now:" label such as "Editing app.js".
- Activity view: one mission card per session active in the last 3 hours, with progress ("X of Y handoffs done") and a list of the last 40 handoffs with status (running, completed, error or stale).
- Directory view: a searchable list and org chart of every agent and skill, with call counts and all-time tokens per agent.
What it reads, and what it never reads
It reads ~/.claude/agents, ~/.claude/skills, plugin skills and the session transcripts. From transcripts it extracts tool names, task titles, status, timestamps, token counters, the last folder name of the working directory and session titles. Message text, prompts and tool outputs are never stored or sent. The service binds to 127.0.0.1:4517 and makes no outbound network request.
How to set it up
- Install Node.js 18+ (Node 20+ on Linux) and confirm with
node -v. - Download the service and start it with
node server.jsfrom its folder. There is nonpm install. The setup guide has the download and the Windows auto-start steps. - Open the live Office page, or
http://localhost:4517. If your browser asks for local network access, allow it. - Start a Claude Code session that uses a subagent and watch the handoff appear.
Honest limits
- It is read-only: it cannot start, stop or edit agents.
- Token figures are counts, not dollars, and start when the service starts (per-agent totals are all-time on this PC). Use
/usagefor cost. - It depends on the transcript format. If Claude Code changes it, detection may break.
- It sees only the PC where it runs. It is not a team or cloud dashboard.
Which method should you use?
| Method | Setup effort | Live across sessions | Shows who assigned what | Tokens | Message text exposed |
|---|---|---|---|---|---|
/tasks panel | None | No (current session) | Subagent tree | Not the focus | Stays in session |
/usage | None | No (point in time) | Percentages by subagent and skill | Yes, plus estimated cost | Stays in session |
| Status line | Write a script | No (one session) | No | Context and cost fields | Your script decides |
| Hooks | Edit settings, write a script | Yes | You build it | Not in the event payload shown | Payload includes some text fields |
| OpenTelemetry | Collector plus charts | Yes | Via agent.name attribute | Yes, plus cost | Redacted by default |
| Transcripts | None | Yes, if you tail them | Manual | In the raw lines | Yes, raw |
| Local dashboard (Agent Office) | Node.js plus one command | Yes | Yes | Counts, no dollars | Never read |
A practical combination: keep /usage for cost, and use a local dashboard for the live picture of who is doing what.
Frequently asked questions
How can I see what my Claude Code subagents are doing?
Run /tasks inside the session to list running and recent subagents, and press Enter on one to open its transcript. For a view that outlives the terminal and covers every session on your PC, use hooks, the transcript files under ~/.claude/projects, or a local dashboard such as Agent Office.
Is there a Claude Code dashboard?
Claude Code has built-in views (/tasks, /usage, a status line) but no single live dashboard for all agents. Community tools fill the gap, including hook-based dashboards, usage reports and Agent Office, a free local live map. See the dashboard comparison for a table.
Can I monitor Claude Code without hooks?
Yes. Every session writes a JSONL transcript under ~/.claude/projects, and subagents write their own agent-<id>.jsonl files in a subagents folder. Tools that read those files, including Agent Office, need no hook configuration.
Does monitoring read my prompts?
It depends on the tool. Claude Code's OpenTelemetry export redacts prompts unless you set OTEL_LOG_USER_PROMPTS=1. Agent Office reads only tool names, task titles, status and token counts, and never stores or sends message text.
Can I monitor several projects at once?
Yes. Transcripts for all projects live under ~/.claude/projects, so a tool that watches that folder sees every project. Agent Office shows the project name (the last folder of the working directory) as a tag on each task and session.
Is Agent Office free?
Yes, it is a free local tool. It needs Node.js 18+ (Node 20+ on Linux) and Claude Code. Setup steps are on the setup page.
Sources
- Claude Code sub-agents (
/tasks, transcripts, model resolution): https://code.claude.com/docs/en/sub-agents - Manage costs (
/usage, attribution): https://code.claude.com/docs/en/costs - Status line (
statusLine, JSON fields): https://code.claude.com/docs/en/statusline - Hooks reference (
SubagentStart,SubagentStop, settings locations): https://code.claude.com/docs/en/hooks - Monitoring usage with OpenTelemetry: https://code.claude.com/docs/en/monitoring-usage
- Agent Office facts: Agent Office README and source code, verified 2026-11-30
Claude and Claude Code are trademarks of Anthropic. Claud Agency is an independent tool by ECOMHUTSY and is not affiliated with Anthropic.
Frequently asked questions
How can I see what my Claude Code subagents are doing?
Run /tasks inside the session to list running and recent subagents, and press Enter on one to open its transcript. For a view that outlives the terminal and covers every session on your PC, use hooks, the transcript files under ~/.claude/projects, or a local dashboard such as Agent Office.
Is there a Claude Code dashboard?
Claude Code has built-in views (/tasks, /usage, a status line) but no single live dashboard for all agents. Community tools fill the gap, including hook-based dashboards, usage reports and Agent Office, a free local live map. See the dashboard comparison article for a table.
Can I monitor Claude Code without hooks?
Yes. Every session writes a JSONL transcript under ~/.claude/projects, and subagents write their own agent-<id>.jsonl files in a subagents folder. Tools that read those files, including Agent Office, need no hook configuration.
Does monitoring read my prompts?
It depends on the tool. Claude Code's OpenTelemetry export redacts prompts unless you set OTEL_LOG_USER_PROMPTS=1. Agent Office reads only tool names, task titles, status and token counts, and never stores or sends message text.
Can I monitor several projects at once?
Yes. Transcripts for all projects live under ~/.claude/projects, so a tool that watches that folder sees every project. Agent Office shows the project name (the last folder of the working directory) as a tag on each task and session.
Is Agent Office free?
Yes, it is a free local tool. It needs Node.js 18+ (Node 20+ on Linux) and Claude Code. Setup steps are on the setup page.