What Background Sessions Are
Claude Code added a /bg command that moves your current session into Agent View — a background processing mode where Claude continues working independently while you open a new session or step away.
The practical implication: time-consuming tasks (large refactors, test investigations, build monitoring) no longer require you to sit and watch. You delegate, background it, and check results when it's done. This shifts the interaction model from turn-based conversation to async delegation.
Basic Usage
Inside a Claude Code terminal session, after giving Claude a task:
/bg
Your active task moves to Agent View. From there you can:
- Start a new session for different work
- Monitor progress through Agent View's real-time status updates
- Close the terminal and reconnect later via Remote Control
Agent View displays multiple background tasks in parallel, with inline updates as Claude makes progress.
Practical Workflow Patterns
Pattern 1: Delegating Large Refactors
TypeScript strict mode migrations, dependency upgrades, codebase-wide renaming — tasks that are time-consuming but follow clear rules are good candidates for delegation.
# Give Claude a scoped, clear instruction
> Enable strict mode in tsconfig.json and fix all resulting type errors in src/.
Constraints:
- Don't change runtime logic — type-level fixes only
- Avoid using `any`
- If a function signature must change, make the smallest change necessary
Run `npm run type-check` when done to verify zero errors.
/bg # Move to background, open new session
While Claude works through the type errors, you're free to work on something else.
Pattern 2: Test Failure Investigation
> Investigate the failing unit tests from npm test output.
Skip E2E tests. Fix the failures without changing test assertions —
if a test assertion seems wrong, flag it in a comment rather than removing it.
Run npm test again when done to confirm all unit tests pass.
/bg
Claude will systematically work through failures while you're in another session.
Pattern 3: Build and Deploy Monitoring
> Run docker compose build. If it succeeds, run docker compose up -d
and check that all containers pass their health checks.
If anything fails, report the exact error output and stop.
/bg # Claude watches and acts on results
Writing Effective Instructions for Background Tasks
The quality of background execution depends heavily on instruction specificity. When Claude can't ask follow-up questions, it makes judgment calls — the clearer your instructions, the better those judgments will be.
# Too vague for background use
> Fix the type errors
# Specific enough for autonomous execution
> Fix TypeScript type errors in src/components/ only.
Constraints:
- Do not modify test files
- Do not introduce `any` types
- If a fix requires changing function signatures, make the smallest change necessary
- After all fixes, run `npx tsc --noEmit` and confirm zero errors remain
The key elements: scope (which files), constraints (what not to do), success criteria (how to verify), and fallback behavior (what to do when uncertain).
Dispatch and Remote Control
Two more capabilities extend background sessions beyond the terminal.
Dispatch lets you submit tasks programmatically — from CI/CD scripts, external tooling, or scheduled jobs. Claude Code picks up the task, runs it, and returns results. A practical example: automatically trigger a Claude Code review session whenever a new pull request is opened.
Remote Control lets you connect to a running Claude Code session from outside the terminal. Start a task, close your laptop, come back hours later and reconnect to the same session with full context. Useful for handoffs between machines or end-of-day context switches.
Chyros: What's Coming
"Chyros" is an internal codename for a planned Claude Code feature that would run as a persistent background daemon — not waiting for a terminal session to exist, but running continuously and independently. Unlike the current /bg command which requires backgrounding an active session, Chyros would operate asynchronously by design.
This isn't shipped yet, but the direction is clear: Claude Code is moving toward an always-on model where you assign work and get results on your schedule.
Current Limitations
- Background sessions require the latest Claude Code version
- Dispatch is still in beta and not fully available to all users
- Parallel background tasks working on the same files can produce conflicts; scope tasks to separate directories when running multiple agents simultaneously
Takeaway
The /bg command shifts Claude Code from a turn-based interaction model to an async delegation model. The types of tasks that benefit most are time-consuming but rule-governed: refactors, test fixes, code migrations, build monitoring. Tasks that require contextual judgment on ambiguous product decisions are better kept interactive.
Start with clearly scoped, well-constrained tasks and iterate on your instruction style. The more specific your instructions, the more reliable the autonomous execution. As background mode matures, the gap between "AI pair programmer" and "AI team member handling a queue of work" will shrink.