Real-time monitoring of Claude Code sub-agent activity in a tabbed terminal interface. Auto-spawns as soon as any sub-agent starts running.
Displays real-time sub-agent activity with:
The monitor automatically spawns as soon as Claude Code dispatches any sub-agent using the Task tool. It uses Claude Code hooks to detect agent lifecycle events:
# Show agent monitor in current terminal
bun run src/cli.ts show agent-monitor --scenario monitor
# Spawn agent monitor in a new WezTerm/tmux pane
bun run src/cli.ts spawn agent-monitor --scenario monitor
# With initial configuration
bun run src/cli.ts spawn agent-monitor --scenario monitor --config '{
"parentSessionId": "session-123",
"agents": {}
}'
| Key | Action |
|---|---|
| Tab | Switch to next agent tab |
| 1-9 | Jump to agent by number |
| ↑/↓ | Scroll content up/down |
| PgUp/PgDn | Fast scroll (10 lines) |
| g | Jump to top |
| G | Jump to bottom |
| q/Esc | Close monitor |
Each tab shows a status indicator:
For each agent, the monitor displays:
interface AgentMonitorConfig {
parentSessionId: string;
agents: Record<string, AgentState>;
}
interface AgentState {
id: string; // Unique agent identifier
description: string; // Task description
status: "running" | "completed" | "error";
startTime: number; // Unix timestamp
endTime: number | null;
toolCalls: ToolCallRecord[];
gitDiffs: DiffRecord[];
output: string[];
}
The plugin uses the following hooks (defined in hooks/hooks.json):
{
"hooks": {
"PreToolUse": [
{
"matcher": "Task",
"hooks": [
{
"type": "command",
"command": "bun \"${CLAUDE_PLUGIN_ROOT}/src/hooks/pre-tool-use.ts\""
}
]
}
],
"SubagentStop": [
{
"hooks": [
{
"type": "command",
"command": "bun \"${CLAUDE_PLUGIN_ROOT}/src/hooks/subagent-stop.ts\""
}
]
}
]
}
}
Agent state is stored in /tmp/claude-agents-{session}.json and includes: