Managing All Claude Code AI Sessions with the New Agent View
Claude Code’s new Agent View lets developers open a single terminal interface to launch, monitor, and control multiple AI coding sessions, offering commands for background tasks, a Peek preview panel, Attach deep‑dive mode, git worktree isolation, status icons, and a full shortcut reference, all without losing sessions when terminals close.
Problem addressed
Running multiple parallel Claude Code tasks often requires opening many terminal tabs, remembering which pane runs which command, handling permission prompts, and preserving context when a terminal is closed. Agent View consolidates all background sessions into a single fullscreen UI, eliminating these issues.
Getting started
Prerequisites
Claude Code version ≥ v2.1.139
Supported plans: Pro, Max, Team, Enterprise, API
Check version with claude --version and update with claude update if needed
Open Agent View
claude agentsThe terminal switches to a fullscreen view with an input box at the bottom and a session list at the top. Press Esc to exit; background sessions keep running.
Dispatch a task
Type a command in the input box and press Enter:
Refactor the src/utils directory, extracting duplicate code into a shared functionThe new session appears instantly and starts processing. Additional tasks can be queued, for example:
Review code changes in PR #42 Add unit tests for the user moduleEach task runs independently.
Peek – quick replies
Select a session with ↑ / ↓ and press Space to open the Peek preview panel. The panel shows what the session is doing and allows answering prompts (e.g., “Choose option A or B?”) without leaving Agent View.
Attach – full interaction
Press Enter or → to attach to a session, opening a regular claude session identical to the standalone CLI. To return, press ← in an empty input box; the session detaches but continues running.
Backgrounding tasks
From an existing session: /bg # or /bg run tests then auto‑fix failures Directly from the terminal: claude --bg "investigate flaky test cause" With a specific agent:
claude --agent code-reviewer --bg "review comments on PR 1234"After launching, Claude prints the session ID and management commands, e.g.:
backgrounded · 7c5dcf5d claude agents list sessions claude attach 7c5dcf5d open in this terminal claude logs 7c5dcf5d show recent output claude stop 7c5dcf5d stop this sessionStatus icons
✽ (animated) – Working: Claude is executing a tool or generating a reply.
✻ (yellow) – Needs Input: Waiting for user action (permission, answer).
✻ (dim) – Idle: Waiting for input but no specific question.
✻ (green) – Completed: Task finished.
✻ (red) – Failed: Task errored.
∙ (gray) – Stopped: Process exited but can be resumed.
Session persistence
Closing the terminal does not terminate sessions; a supervisor process keeps them alive. Re‑run claude agents to view them, and after machine sleep use claude respawn --all to restore all sessions.
Shortcut reference
Space– Toggle Peek preview panel Enter – Dispatch typed task or enter selected session ← (empty input) – Detach from current session back to the list Shift+Enter – Dispatch and immediately enter the new session Alt+1 … Alt+9 – Jump directly to the N‑th session Ctrl+S – Toggle grouping (by status or by directory) Ctrl+T – Pin / unpin a session Ctrl+R – Rename a session Ctrl+X – Stop a session (press Delete again within 2 s to confirm) ? – Show all shortcuts
File‑edit isolation with git worktree
When a background session needs to modify files, Claude automatically creates a git worktree under .claude/worktrees/. Each session gets its own working copy, preventing conflicts between parallel edits. Merge or push changes before deleting a session.
Managing sessions from the terminal
claude agents # list all background sessions
claude attach <id> # enter a specific session
claude logs <id> # view recent output
claude stop <id> # stop a session
claude respawn --all # restore all sessions after a rebootPractical usage patterns
Batch dispatch + consolidated PR review: launch multiple independent tasks, each with its own sub‑agent, then review all PRs together.
Long‑running agents: continuous PR monitoring, dashboard updates, etc., with a countdown shown in the list.
Temporary context switch: detach with ←, ask a quick question, then re‑attach with →.
Rapid outcome scan: status icons and Peek titles let you instantly identify sessions that have already produced PRs.
Considerations
Each background session consumes its own token quota; running many simultaneously can exhaust tokens quickly.
Session summaries are generated by the Haiku model (~15 s refresh) and add a small token cost.
The feature is currently in Research Preview; shortcuts and UI may change.
Administrators can disable Agent View with the disableAgentView setting.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Su San Talks Tech
Su San, former staff at several leading tech companies, is a top creator on Juejin and a premium creator on CSDN, and runs the free coding practice site www.susan.net.cn.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
