Freeive

claude-code·Published 2026.06.01·Views 2

Claude Code /background: Send Long Tasks to the Back and Move On

A beginner-friendly guide to the /background command, which detaches a long build or test to free up the terminal so you can do other work in parallel.

When you kick off a long-running task like a build or test, the terminal stays tied up until it finishes, so you can't do anything else. /background is the command that sends that task to the back and lets you use the terminal again.

Definition (what it is)

/background is the command that detaches the current session to the background (behind the screen) and frees up the terminal. You can also use the alias (a short name for the same feature) /bg.

"Background" means "a state that keeps running behind the scenes even though you can't see it." Conversely, what's in progress on the current screen is called the foreground. Send a long task to the background and that task keeps running while the terminal frees up so you can type other commands.

How to use it (by difficulty)

Basic — Sending the session to the back

/background

Type this and the current session pulls back and the terminal frees up. The screen shows a notice that the task moved to the background, and you're back to a state where you can enter new commands.

Intermediate — Giving one more instruction and detaching

/background run all the tests

Write an instruction after it and it does that job, then sends it straight to the background. You can handle it in one go, like "run the tests to the end and pull back."

Common pitfalls

  • A task sent to the background also needs the computer to stay on to keep running. Close your laptop or leave it in sleep mode and it may stop, so be careful during long tasks.
  • To bring a backgrounded session back, you have to follow a command that checks the session list or the on-screen notice. If you wonder "where did it go after I sent it," first read the notice that appeared on screen.

Real-world example

Send a task that takes minutes, like a build, to the back with /background, and in the meantime you can look at more code or type other commands in the same terminal. When the task finishes, you just check the result.

Taking it further

Being able to send a session to the back means you can run long and short tasks in parallel. Leave heavy tasks to the background and handle light questions or code checks up front in the meantime — that's how you save time.

Summary

/background (alias /bg) is the command that detaches the current session to the background and frees up the terminal. Use it when you want to leave a long-running task going and do other work in parallel.

Based on: Claude Code v2.1.154 (2026.05)

#클로드코드#ClaudeCode#background#AI coding#vibe coding#developer

Comments

Comments 0

Checking sign-in status…

Loading comments…

Recent

More notes.