<skill name="/background">
<purpose>
# /background — Claude Code Built-in Command

Alias: `/bg`

## What It Does
**Detaches the current session** from your terminal and runs it as a background agent. Your terminal is freed immediately. The session continues working autonomously.

## Usage
```
/background
```

### With a final instruction before detaching
```
/background finish the migration, run all tests, and open a PR when done
```

## Monitoring the Background Session
```bash
claude agents          # list all running background sessions
claude agents attach   # re-attach to a session
```
Or view in the Claude Code web UI at claude.ai/code.

## Re-attaching
```bash
claude agents          # find the session ID
claude --resume &lt;id&gt;   # re-attach
```

## Use Cases
- Large refactors that take 10–30 minutes
- Batch migrations across many files
- Long autoresearch loops
- &quot;Finish this while I'm in a meeting&quot;

## Session Persistence
Background sessions survive terminal closure. They run until the task is complete or you explicitly cancel them.
</purpose>
</skill>