Claude Code Stops Runaway Background Commands After a Time Limit

Claude CodeView original changelog

Claude Code 2.1.285 now stops background Bash and PowerShell commands once they exceed a time limit. The default is 30 minutes and the maximum is 2 hours, set through the command's timeout when it runs in the background. Claude is notified when a command is stopped.

Key Takeaways

  • Background Bash and PowerShell commands now stop after a time limit, which is a behavior change for existing workflows.
  • The default limit is 30 minutes and the maximum is 2 hours.
  • The limit is set through the command's timeout together with run_in_background.
  • Claude is notified when a command is stopped, so it can restart it or change approach.
  • Long-lived processes like dev servers and watchers may need an explicit longer timeout.
  • /tasks now groups Claude Code's own housekeeping under a single System tasks row.

A time limit for background commands

Before this release, a shell command that Claude Code started in the background could run indefinitely. Claude Code 2.1.285 changes that: background Bash and PowerShell commands now stop after a time limit. The limit comes from the command's timeout when it is launched with run_in_background, defaulting to 30 minutes and capped at 2 hours.

What users will notice

When a command hits its limit, Claude Code stops it and notifies Claude, so the agent can decide whether to restart it, raise the timeout or take another approach. Long-running processes such as dev servers, file watchers or slow test suites that previously stayed up all session may now be stopped after the limit, so sessions that depend on them should set a longer timeout explicitly, up to the 2 hour maximum.

Related task display change

The same release changes /tasks to fold background work that Claude Code runs for itself under one "System tasks" row. Pressing Enter on that row shows those tasks, which keeps the list focused on the commands the user actually asked for.