Source Intelligence

DisclaimerUnofficial, and not affiliated with Anthropic. Nearly all of this is read straight out of what ships: npm bundles, captured prompts, published docs. Anthropic's own notes go in verbatim, marked as theirs. The rest is my reading, and every entry carries the strings behind it. If one looks wrong, vote it down and say why.

All of v2.1.246 Home All releases olderv2.1.245 v2.1.247newer
Claude Code v2.1.246

Idle exit after a configurable delay

Use it now
Useful4 Signal3
Session Lifecycle Notable

Set a delay and Claude Code will shut itself down after sitting idle that long.

CLAUDE_CODE_EXIT_AFTER_STOP_DELAY
What

Set CLAUDE_CODE_EXIT_AFTER_STOP_DELAY to a positive value and Claude Code will now shut itself down once the session has sat idle for that whole window. With the variable unset or non-positive the watchdog never starts, so behaviour is unchanged.

Details
  • The timer restarts itself after each check rather than firing once, so a session that becomes busy again resets the window.
  • If the idleness check itself throws, the chain stops and the error is logged instead of taking the process down.
Usage
CLAUDE_CODE_EXIT_AFTER_STOP_DELAY=300000 claude
Evidence

Exiting after

Strings lifted out of the shipped bundle, so the claim above can be checked against them.

See this entry in the whole of v2.1.246 →