Multiple agents, background work, and workflows
Agent View, background sessions, batch, fork, goals, loops, dynamic workflows, teams, and cache/cost boundaries.
Parallel execution includes several different mechanisms:
| Mechanism | Unit | Use |
|---|---|---|
| Subagent | Focused delegation in a session | Research, review, context isolation |
| Background session | Complete session in the background | Long work with a free terminal |
| Agent View | Multiple background sessions | Monitor task progress |
| Batch | Bundled migration skill | Repeated changes across worktrees |
| Dynamic workflow | Script-orchestrated subagents | Audits, migrations, research, repair loops |
| Agent teams | Named collaborating teammates | Sustained coordinated work |
See Teams and channels for configuration and Advanced workflows for comparisons.
#Background sessions
/background
/bg Continue running tests and repair failuresManage from the shell:
claude agents
claude agents --json
claude attach <id>
claude logs <id>
claude stop <id>
claude respawn <id>
claude rm <id>| Action | Cache effect |
|---|---|
| Background | Same session continues within TTL |
| Attach | Resume its existing history |
| Respawn | Retains conversation; changed version/environment can alter prefix |
| Stop | No further TTL refresh |
#Agent View
| Capability | Purpose |
|---|---|
| Monitor | State and input needs |
| Peek/reply | Send input without fully attaching |
| Attach | Enter a background session |
| Dispatch | Start a new task |
| Filter | Directory, status, PR |
| JSON | Scriptable agents output |
Use worktrees to isolate writes and clean completed workspaces when the directory grows.
#Fork versus branch
| Command | Behavior | Use |
|---|---|---|
| /branch [name] | Copy conversation and switch to it | Personally explore another route |
| /fork | Send current context to a background subtask | Independent side work |
Both inherit a prefix that may remain reusable within TTL.
#Batch
Batch typically:
- Studies the repository.
- Splits work into roughly 5–30 independent units.
- Presents a plan for approval.
- Creates isolated worktrees and background agents.
- Implements/tests each unit and returns PRs or results.
| Suitable task | Example |
|---|---|
| Migration | /batch migrate src from Redux to Zustand |
| Repeated replacement | /batch replace deprecated API usage across packages |
| Test coverage | /batch add missing tests for service modules |
| Broad review | /batch audit every package for unsafe env access |
| Poor fit | Reason |
|---|---|
| Vague requirements | Incorrect task decomposition |
| Strongly coupled edits | Merge conflicts |
| No validation criteria | Hard to converge |
| Every step needs manual review | Background concurrency obscures sequencing |
#Dynamic workflows
Claude writes an orchestration script that calls subagents for repeatable, separable work and aggregates results.
Use a workflow to audit all content/docs pages for untranslated UI text and broken links.
Return one consolidated report.Migrate each package's ESLint configuration with one subagent per package,
then run the combined validation.| Aspect | Batch | Dynamic workflow |
|---|---|---|
| Purpose | Large code-change skill | General orchestration |
| Units | Worktrees/subagents | Script-defined |
| Reuse | Task-oriented | Script can be retained |
| Observation | Background sessions/progress | /workflows |
#Goals
A goal defines completion criteria and lets Claude continue until achieved or genuinely blocked.
/goal Complete the documentation migration: new pages build, no raw directives,
new routes return 200, and mobile pages have no horizontal overflow.| Good goal | Weak goal |
|---|---|
| Verifiable conditions | Make it good |
| Test/check commands | Improve it as much as possible |
| Autonomous progress | Wait for approval on every routine step |
| Defined blockers | Stop at every small error |
Goal state itself does not rebuild the system prompt. Continued turns append normally and refresh TTL; compaction/model changes retain their usual effects.
#Loops and schedules
| Mechanism | Use | Cache consideration |
|---|---|---|
| Loop | Periodic checks in current session | Intervals within TTL help |
| Schedule | One-off or recurring work | Longer intervals may benefit from supported longer TTL |
| Routines | Hosted automation | Independent cloud cache |
Do not expect a five-minute cache to remain warm through long gaps. Short prompts, stable rules, and explicit output limits matter. See Scheduling.
#Cache and cost boundaries
| Unit | Relationship |
|---|---|
| Main session | Own prompt/project/history |
| Subagent | Separate conversation, typically its own default TTL |
| Background session | Complete history and TTL |
| Worktree | Different paths can change prompt prefixes |
| Cloud session | Separate environment, not local Passion8 cache |
| Advisor | Toggle preserves main cache; advisor requests have separate behavior |
#Practical recommendations
- Use the main session for small work.
- Isolate broad research in subagents.
- Plan decomposition before batch/workflow migrations.
- Combine parallel writers with worktrees and shared acceptance criteria.
- Give every task an explicit validation command.
- Avoid overlapping file regions; conflict resolution can erase concurrency gains.
#Official references
Support
Need help?
For setup, billing, or model issues, email us. Check the status page for uptime.
WeChat / QQ support is available at the bottom right.

