Keyword: BACKGROUND
From @learningwithcole
A long test run or build doesn't have to hold your terminal hostage. Claude Code can run it in the background while you keep talking to Claude. Three shortcuts cover it.
The 3 shortcuts
Ctrl+B: sends what's running to the background. Works on Bash commands and agents. In tmux, press it twice (tmux usesCtrl+Bitself)./tasks: shows every running shell and subagent in one place.Ctrl+X Ctrl+K: stops all background subagents in the session. Press it twice within 3 seconds to confirm.
You can also just ask: "run the test suite in the background".
What happens after you press Ctrl+B
- The command keeps running and gets its own task ID.
- Your prompt is free again. Ask Claude something else, start a second task, or step away.
- The output goes to a file. When the task finishes, Claude reads that file with its Read tool, so nothing is lost and you don't need a second terminal window.
A command that runs past its timeout moves to the background on its own instead of being stopped.
Agents run in the background too
When Claude sends a subagent off to explore your codebase, that subagent starts in the background by default. You keep working while it reads, and its results reach Claude when it's done. A finished subagent stays in /tasks for 30 seconds, and pressing Enter on it opens what it did.
When to background a job
Good fits:
- Test runners (jest, pytest)
- Builds (webpack, vite, make)
- Package installs (npm, yarn, pnpm)
- Dev servers
Keep it in the foreground when:
- You need the result before your next step, like a failing test you're about to fix.
- The command is quick. Backgrounding a two-second command just adds a step.
Good to know
- Background tasks are cleaned up when you exit Claude Code.
Ctrl+Tis not the background view. It shows Claude's to-do checklist. Use/tasksfor running work.- Background tasks are off if
CLAUDE_CODE_DISABLE_BACKGROUND_TASKSis set to1. ThenCtrl+Bdoes nothing.
That’s the whole guide.
Want the next tool when it posts?
Get new guides by email. The guides stay free here either way.