Agent view is a control screen for background Claude Code sessions. Each row represents a separate Claude Code conversation that can continue working without a terminal attached.
It is especially useful when you have several independent tasks, such as fixing a bug, reviewing a pull request, and investigating a flaky test at the same time. citeturn0view0
The official documentation describes agent view as a research preview. The interface and keyboard shortcuts can change as the feature evolves. Current documentation requires Claude Code v2.1.139 or later.
claude --version
Organizations can disable agent view with the managed disableAgentView setting. citeturn0search0
claude agents
Agent view takes over the terminal. An input appears at the bottom where you can dispatch new tasks. If workspace trust has not yet been accepted, Claude Code shows the normal trust dialog first. citeturn0view0
Type a task and press Enter:
Fix the failing login test and report what caused it.
A new background session appears as a row. You can dispatch another task immediately:
Review the latest pull request for security issues.
Each prompt starts a separate background session. Multiple sessions can run in parallel. citeturn0view0
Select a row with the arrow keys and press Space. The peek panel shows the latest output or the question the session is waiting on.
If Claude needs an answer, type it and press Enter. You can respond without attaching to the full conversation.
Press Enter or → on a selected row to enter the full Claude Code conversation.
When the prompt is empty, press ← to return to agent view. Detaching does not stop the background session. citeturn0view0
claude agents
↓
Dispatch task
↓
Claude works in background
↓
Watch status
↓
Needs input?
↙ ↘
Yes No
↓ ↓
Peek/Reply Keep working
↓
Attach when needed
↓
Review result
| State | Meaning |
|---|---|
| Working | Claude is actively running tools or generating a response. |
| Needs input | Claude needs an answer, permission decision, or another action only you can provide. |
| Idle | The session has nothing to do and is ready for your next prompt. |
| Completed | The task finished successfully. |
| Failed | The task ended with an error. |
| Stopped | The session was stopped or its process ended. |
The icon's shape also indicates whether the underlying process is still alive. A dot can represent a process that has exited but whose session can still be resumed by replying or attaching. citeturn0view0
A row can show:
Needs input
✻ power-up design double jump or wall climb? 1m
Working
✽ collision detection Adding collision checks 2m
Completed
✻ title screen result: menu finished 9m
Background sessions are not tied to an open terminal. You can close agent view and return later. Sessions are persisted on disk and can reappear when you open agent view again.
However, the machine itself still matters: background sessions stop when the machine sleeps or shuts down. They can be restarted afterward. citeturn0search0
By default, agent view can show background sessions across your projects.
Use --cwd to narrow the list to a directory:
claude agents --cwd ~/projects/my-app
This is useful when you have many sessions and want to focus on one project. citeturn0view0
Agent view groups sessions by state by default. You can switch to directory-based grouping.
| Action | Shortcut |
|---|---|
| Switch grouping | Ctrl+S |
| Pin/unpin session | Ctrl+T |
| Rename session | Ctrl+R |
| Reorder selected session | Shift+↑ / Shift+↓ |
| Collapse group | Enter on group header |
| Stop/delete session | Ctrl+X; press again within two seconds to delete |
You can type filters into the dispatch input instead of launching a new task.
| Filter | Meaning |
|---|---|
a:<name> | Show sessions running the named agent. |
s:<state> | Show sessions in a particular state, such as s:blocked. |
#1234 | Find the session working on that pull request. |
| PR URL | Find the session associated with that pull request. |
| Shortcut | Action |
|---|---|
↑ / ↓ | Move between rows. |
Enter | Attach to selected session, or dispatch text in the input. |
Space | Open/close peek panel. |
Shift+Enter | Dispatch and attach immediately. |
→ | Attach to selected session. |
Alt+1 … Alt+9 | Attach to a session by position in the focused group. |
Tab | Browse available subagents or accept a highlighted suggestion. |
Ctrl+S | Switch grouping. |
Ctrl+T | Pin/unpin. |
Ctrl+R | Rename. |
Ctrl+G | Open dispatch prompt in $EDITOR. |
Ctrl+X | Stop; press again quickly to delete. |
Esc | Close peek, clear input, or exit. |
? | Show all shortcuts. |
If you have custom subagents, agent view can start a session using one of them.
@code-reviewer Review the authentication changes.
You can also put the subagent name first:
code-reviewer Review the authentication changes.
If the first word matches a custom subagent name, that agent can become the session's main agent. You can press Tab on an empty input to browse dispatchable subagents. citeturn0view0
You can mention a repository when you opened agent view from a parent directory containing several repositories:
@my-app Fix the failing checkout test.
Alternatively, open agent view directly inside the target directory. From the shell, you can also change directory and use the background command. citeturn0view0
If you package a recurring workflow as a Skill, agent view can dispatch it from the input:
/my-skill
Type / to browse available dispatchable Skills.
This avoids rewriting the same large prompt every time. citeturn0view0
You do not have to open agent view first. You can launch a background session directly:
claude --bg "Investigate the flaky checkout tests and report the root cause."
The session then appears in agent view. citeturn0search0
If you are already inside a normal Claude Code session, you can send it to the background:
/bg
You can also press ← on an empty prompt. The session keeps running and appears as a row in agent view. citeturn0view0
Agent view also supports copying a session with /fork.
This is useful when you want a new session based on an existing conversation without continuing in the same session.
Agent view is primarily for Claude Code sessions, but background shell commands can also be launched from the workflow. This is useful for long-running commands that do not require Claude reasoning.
Background sessions can work in their own worktrees when isolation is configured or when the session is moved into a worktree. This helps prevent parallel coding sessions from editing the same checkout.
Session A → worktree A
Session B → worktree B
Session C → worktree C
Worktrees are the file-isolation mechanism; agent view is the session-management interface. citeturn0search1
If a session has its own worktree, deleting the session can remove that worktree. Therefore, merge, push, or otherwise preserve important changes before deleting the session.
| Command | Purpose |
|---|---|
claude agents | Open agent view. |
claude attach <id> | Attach to a session. |
claude logs <id> | Print recent session output. |
claude stop <id> | Stop a session. |
claude kill <id> | Alias for stopping a session. |
claude respawn <id> | Restart a stopped session with its conversation intact. |
claude respawn --all | Restart all stopped sessions. |
claude rm <id> | Remove a session from the list. |
Background sessions are hosted by a per-user supervisor process. It is separate from your terminal and from agent view. It starts automatically when you first background a session or open agent view.
The supervisor allows sessions to continue even after agent view closes. When a finished session remains unattached for about an hour, the supervisor can stop its process to free resources; the transcript and state remain on disk so the session can be restarted when you attach, peek, or reply.
The documentation describes local state under the Claude Code configuration directory. With the default configuration this includes:
| Path | Purpose |
|---|---|
~/.claude/daemon.log | Supervisor log. |
~/.claude/daemon/roster.json | List of background sessions used for reconnecting. |
~/.claude/jobs/<id>/state.json | Per-session state shown in agent view. |
If CLAUDE_CONFIG_DIR is set, the supervisor uses that directory instead of the default ~/.claude. citeturn0search0
While agent view is open, Claude Code can notify you when a local background session needs input, finishes, or fails.
The notification behavior uses the configured notification channel and can interact with the Notification hook.
Every background session consumes subscription usage independently. Running ten agents in parallel can therefore consume quota much faster than running one session.
Background sessions run locally. If the machine sleeps or shuts down, active sessions stop. After the machine is available again, stopped sessions can be restarted from their saved state.
claude respawn --all
That is normal when no background sessions exist. Dispatch your first task from the input at the bottom.
Background sessions do not survive sleep/shutdown. Attach, peek, or reply to restart one, or run:
claude respawn --all
A finished session that has remained unattached for roughly an hour may have had its process stopped. Attaching starts a fresh process from saved state, so there can be a short startup delay.
List them:
git worktree list
Then remove unwanted worktrees:
git worktree remove <path>
| Feature | Best mental model | Use when |
|---|---|---|
| Subagent | Specialist inside one conversation. | A side task should return a result to the main session. |
| Agent view | Control room for separate sessions. | You have multiple independent tasks and want to monitor them. |
| Agent team | Coordinated group of Claude sessions. | Workers need to communicate and collaborate. |
| Worktree | Separate Git workspace. | Parallel sessions need file isolation. |
Suppose you have three independent tasks:
Task 1: Fix checkout bug
Task 2: Review authentication PR
Task 3: Investigate flaky tests
Open:
claude agents
Dispatch each task:
Fix the checkout bug and run the relevant tests.
Review the authentication PR for security issues.
Investigate the flaky tests and identify the root cause.
Peek at the session needing input, reply without leaving agent view, and attach to a session when you need the full conversation.
--cwd when many projects make the session list noisy.--cwd to focus on one project when necessary.Ctrl+T do?Ctrl+X do?claude --version.claude agents.Space to peek.Enter to attach to a session.← on an empty prompt to return to the agent list.Ctrl+R.Ctrl+T.Ctrl+X.claude agents
↓
Dispatch many tasks
↓
Claude sessions run independently
↓
Monitor status
↓
Peek / Reply
↓
Attach when needed
↓
Detach and keep working