Cole Seifert

Keyword: BACKGROUND

The background tasks cheat sheet

Free guide. No signup. 2 min read Checked 2026-10-25 against code.claude.com/docs/en/interactive-mode and code.claude.com/docs/en/sub-agents.

Download PDF Watch the reel on Instagram

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 uses Ctrl+B itself).
  • /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

  1. The command keeps running and gets its own task ID.
  2. Your prompt is free again. Ask Claude something else, start a second task, or step away.
  3. 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+T is not the background view. It shows Claude's to-do checklist. Use /tasks for running work.
  • Background tasks are off if CLAUDE_CODE_DISABLE_BACKGROUND_TASKS is set to 1. Then Ctrl+B does 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.

You’ll get one email to confirm first. Unsubscribe anytime.