BACKGROUND TASKS
Long task, push it to the background.
Bash with run_in_background, or an agent in the background. Claude keeps interacting while the build, the test or the agent runs.
You get notified when it finishes. No watching paint dry.
Combines strongly with subagents: you delegate a big investigation, keep coding something else, receive the report when it is ready.
In practice
// SDK
Bash({
command: "npm run build",
run_in_background: true,
description: "Build production"
})
# CLI: agent or bash, both accept --background
# You get a notification when it finishes,
# without blocking the session.This practice is part of Claude Code OS, the full blueprint of the practices that separate following a tutorial from actually working with Claude. Ler em português.