What
A self-hosted runner is a program you run on your own machines to pick up and run Claude Code sessions. It has a new --shutdown-drain-sec <n> option, stored as shutdownDrainMs.
- On the first SIGTERM (the usual stop signal), the runner stops looking for new work. The work already being fetched and any running hooks get up to n seconds to finish. Hooks are user-set commands that run at certain moments.
- A second signal, or SIGINT (Ctrl+C), stops whatever is still running.
- The value must be a whole number of seconds from 0 to 3600. The default is 0, which turns the drain off and stops work at once.
- The runner logs its drain behaviour and warns if
--shutdown-drain-secis less than the hook timeout plus a margin. - The runner supports a 'tool-server' session kind with its own
.tool-server-configfolder. Before, only.claude-configwas listed.
Before, the first signal stopped everything at once and a second one forced the exit.
Why
Operators can restart or roll out runners without cutting off sessions and hooks that are still running, as long as the drain time is long enough.
One source agreesOne thing we can check says the same as this entry.
Anthropic's release notes agree
Added --shutdown-drain-sec to claude self-hosted-runner orchestrator: on SIGTERM it stops polling and gives the poll in flight and running…