Cmd. /background
Detach the current session as a background agent (/bg).
Written and reviewed by Eric Han · Co-founder & CTO, reopt
Key takeaways
- Detach the current session as a background agent (
/bg). - Check the input surface and availability before using the examples below.
Purpose
Detach the current session as a background agent (/bg).
/background [prompt]Availability
| Field | Value |
|---|---|
| Input surface | Running CLI prompt |
| Kind | Built-in |
| Status | Current reference |
| Aliases | /bg |
| Documented minimum | Not specified |
| Reviewed against | 2026-10-23 · Claude Code 2.1.308 |
The installed command menu and account or organization settings determine availability.
Examples
/backgroundEffects and persistence
The session keeps running in the background and releases the terminal. Monitor it with claude agents.
Cautions
Detaching keeps work running. Use Agent View to inspect it; leaving the terminal does not stop the agent. Replies sent from claude agents arrive as queued messages from v2.1.287, and slash commands other than /stop sent during a turn run when it ends; from v2.1.290, /model, /effort, and /rename apply right away instead. From v2.1.295, Ctrl+C at the idle prompt of an attached background session leaves a pending /loop wakeup alone: pressing it twice detaches and the loop keeps running, and Esc stops the loop. When you background a session with ← on an empty prompt, a turn or ! command started while the session moves is stopped instead of finishing out of sight from v2.1.296, and stopping the turn while ← waits for the current tool shows "Backgrounding cancelled" (v2.1.295).