Agent View: Manage Multiple Claude Code Sessions from One Screen
Agent View is a real-time dashboard that dispatches Claude Code sessions, monitors their status, throttles execution with input queues, and tracks cost across all running agents. Instead of juggling 50 terminal tabs, you see one unified view: running agents, completed tasks, pending queue, and total token spend.
This guide covers the Agent View API, how to wire it into your CI/CD, approval workflows (human-in-the-loop), and the scaling boundary. At 100+ concurrent agents, you'll hit token rate limits; we'll show you how to detect and handle backpressure. The real gotcha: runaway agents. We'll trace how a single agent bug can drain your budget in minutes and the circuit breaker pattern that stops it.
Dispatch and Manage Many Sessions at Once
Agent View exposes an API to spawn, monitor, and kill agent sessions. You POST a job (agent name, input, worktree path) to the dispatcher; it queues the job, executes it, and streams updates to the dashboard. You can cancel a running agent, see its real-time output, and mark a job as approved/rejected before execution.
The dispatcher maintains a job queue. When you submit 100 jobs, they don't all run at once. Instead, they wait for a free slot (based on max_concurrent_agents setting). This prevents resource exhaustion and lets you manage throughput.
Quick reference
- POST /dispatcher/jobs creates a job with agent config, input, and worktree.
- Each job gets a unique session_id.
- Agent runs in subprocess; output streamed to WebSocket.
- GET /dispatcher/jobs lists all jobs (running, queued, completed).
- DELETE /dispatcher/jobs/{session_id} kills a running agent.
Remember this
Agent View dispatcher queues jobs, throttles concurrent execution, and streams output. Each job has a unique session_id.
Real-Time Status Dashboard
The dashboard is a web UI (or API endpoint) that shows all active jobs, their status (running, queued, completed, failed), elapsed time, token usage, and output tail. You can click on a job to see full output or kill it mid-execution.
The backend maintains a job store (in-memory or database) that tracks state. Every state change (queued → running → done) broadcasts to WebSocket clients. This means the dashboard updates in real-time without polling.
Quick reference
- Dashboard queries GET /dispatcher/jobs for current state.
- WebSocket connects to /dispatcher/subscribe for real-time updates.
- Each update includes: session_id, status, output, tokens_used, elapsed_seconds.
- Click to expand: full logs, error traces, tool calls.
- Kill button: DELETE /dispatcher/jobs/{session_id} sends SIGTERM.
Remember this
Dashboard aggregates all sessions in one view. Real-time updates via WebSocket. Click to expand, kill to stop.
Input Queues and Approval Workflows
For critical workflows, you might want human approval before an agent runs. Agent View supports approval gates. When you POST a job with requires_approval: true, it enters the queue but doesn't execute. An approver reviews the input (and optionally the agent's plan), then approves or rejects via the dashboard.
Once approved, the job moves to execution. Once rejected, it's marked as skipped. This pattern is essential for infrastructure changes, financial transactions, or any high-stakes automation.
Quick reference
- Create job with
requires_approval: true. - Job enters approval queue; dashboard shows pending approvals.
- Approver reviews input and context (agent description, output if dry-run).
- POST /dispatcher/jobs/{session_id}/approve or /deny.
- Approved → execution queue; Denied → marked as skipped.
Remember this
Approval gates enable human oversight. Pending jobs wait for approval; approved jobs execute; rejected are skipped.
Cost Tracking Across Sessions
Every API call costs tokens. With 50 agents running, your bill multiplies fast. Agent View logs token usage per session and aggregates it. At the end of each job, it records input_tokens and output_tokens. The dashboard shows total tokens (and cost estimate) across all sessions.
You can set a hard budget cap: if cumulative cost exceeds $X, stop accepting new jobs and alert the team. This prevents runaway spending if an agent gets stuck in a loop.
Quick reference
- Each job logs: input_tokens, output_tokens, model, timestamp.
- Dashboard aggregates: total_tokens, estimated_cost (tokens * $rate).
- Set budget limit: max_cumulative_cost (e.g., $100 per hour).
- If limit exceeded: queue new jobs but don't execute; alert on Slack.
- Log token usage per agent type (code-reviewer vs. db-migration) for optimization.
Remember this
Log tokens per session. Track cumulative cost. Set a budget cap and alert if exceeded.
Scaling Patterns (100s of Sessions)
At 10 concurrent agents, Agent View runs on a single machine. At 100, you need horizontal scaling: multiple dispatcher instances, a shared job store (database), and a message broker (Redis/Kafka) for job distribution.
The pattern: agents submit jobs to a queue (e.g., Redis list). Dispatcher instances pop jobs, execute them, and post results back to a results queue. The dashboard subscribes to the results queue and updates in real-time. This decouples job submission from execution, letting you scale execution independently.
Quick reference
- Dispatcher instances are stateless; share a Redis job queue.
- Job store (database): persists jobs for replay and audit.
- Message broker: distributes jobs and results.
- Dashboard subscribes to results channel for real-time updates.
- Circuit breaker: if Anthropic API is rate-limited, back off exponentially.
Remember this
Scaling pattern: stateless dispatchers, shared queue, persistent store, message broker, circuit breaker.
Monitoring and Observability
With many agents, bugs compound. An agent that retries indefinitely can drain your budget in hours. Observability is how you catch it. Log every state transition (queued → running → done), every API call, every error. Expose metrics: job throughput (jobs/min), avg latency (seconds), error rate (%), token efficiency (tokens/job).
Key metrics to watch: job queue depth (if growing, dispatcher is too slow), max concurrent jobs (if stuck at limit, increase capacity), error rate (if spiking, agents are hitting bad state).
Quick reference
- Log job lifecycle: submitted, queued, approved, running, done, failed.
- Metrics: throughput (jobs/min), latency (p50, p95, p99), error rate.
- Alerts: queue depth > 100, error rate > 5%, cost/hour > budget.
- Expose metrics on /metrics endpoint (Prometheus format).
- Dashboard shows: current jobs, job history, error logs, cost breakdown.
Remember this
Log every state change. Monitor queue depth, latency, error rate, and cost. Alert on anomalies.
Integration with Team Workflows
Agent View is most powerful when integrated into your team's workflow. Slack bot that posts job results into a channel. GitHub Actions that dispatch jobs and report status. Jira tickets auto-updated with agent output.
Example: A GitHub Actions workflow for pull requests. On PR open: dispatch a code-review agent to review the PR. Results posted as a GitHub comment. Approver checks the comment; if satisfied, approves the agent job, which can then auto-merge or notify the team.
This closes the loop: developer pushes PR → agent reviews → team approves → merge. All automatic, all tracked.
Quick reference
- Slack integration: POST message to #agent-results with job summary.
- GitHub integration: create PR comment with agent output.
- Jira integration: update ticket with agent-generated subtasks.
- Webhook: trigger dispatch on GitHub PR, Jira ticket creation, Slack command.
- Feedback loop: emoji reactions on results for approval/rejection.
Remember this
Integrate Agent View into Slack, GitHub, Jira. Automate dispatch and close the human-in-the-loop workflow.
Key takeaway
Agent View lets you scale Claude Code to teams. Dispatch jobs, track cost, approve workflows, and integrate into your stack. For orchestrating multiple agents in sequence (e.g., code review → tests → merge), read the dynamic workflows guide. For cost optimization at scale, see the Agent SDK guide on token tracking.
Polo Khan
Lead Author & Systems ArchitectSoftware engineer and distributed systems architect specializing in backend scalability, cloud-native infrastructure, databases, and AI engineering workflows. Author and maintainer of Core Concept Learning.
Related Articles
Explore this topic