brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: Ctrl+B sends a slow command in Claude Code to the background

Claude
~/tips/tip-claude-ctrl-b-background-command

Ctrl+B

Moves a long-running shell command out of the way so you and Claude can keep working.

Claude starts a test suite or a dev server and the session just sits there waiting. You don’t have to.

While a Bash command is running in the foreground, press:

Ctrl+B

The command keeps running, but in the background. Claude Code gives it a task ID, writes its output to a file, and you can send the next prompt right away. Claude reads the output file when it needs the result. /tasks shows what is still running and lets you stop it.

You can also just ask: “start the dev server in the background”. And a command that hits its timeout is moved to the background automatically instead of being killed, unless it starts with sleep.

Inside tmux, Ctrl+B is tmux’s prefix key, so press it twice. I can see that one tripping people up, because the first press seems to do nothing.

Background tasks end when Claude Code exits. That’s good for a dev server you forgot about, less good if you expected a long build to finish on its own. If you need that, run it in a separate terminal. A task whose output passes 5 GB is stopped, which a chatty watch process can reach faster than you’d think.

Further reading: Background Bash commands

More Claude tips /recap /focus /skill-doctor /autocompact 500k claude purge ~/work/my-repo --dry-run All Claude tips (83) All topics

Link