{"version":"2.1.246","anchor":"idle-exit-after-a-configurable-delay","canonical_anchor":"idle-exit-after-a-configurable-delay","heading":"Idle exit after a configurable delay","tier":"use","area":"Session Lifecycle","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.246\/e\/idle-exit-after-a-configurable-delay","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.246","markdown":"### Idle exit after a configurable delay\n\nSet a delay and Claude Code will shut itself down after sitting idle that long.\n\n**What**\n\nSet `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.\n\n**Details**\n\n- The timer restarts itself after each check rather than firing once, so a session that becomes busy again resets the window.\n- If the idleness check itself throws, the chain stops and the error is logged instead of taking the process down.\n\n**Usage**\n\n`CLAUDE_CODE_EXIT_AFTER_STOP_DELAY=300000 claude` **Evidence** `Exiting after `\n\n- Area: Session Lifecycle\n- Names: `CLAUDE_CODE_EXIT_AFTER_STOP_DELAY`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 3\/5"}