{"name":"CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF","slug":"claude-code-disable-bg-exit-handoff","family":"env","title":"Environment variables","noun":"environment variable","description":"Set to `1` to stop a [background session's](\/docs\/en\/agent-view) running background shell commands, dynamic workflows, and, as of v2.1.198, background subagents when the [supervisor](\/docs\/en\/agent-view#the-supervisor-process) stops, restarts, or updates that session's process, instead of handing them to the session's next process. Affects only that handoff: backgrounding a session with `\u2190` or [`\/background`](\/docs\/en\/agent-view#from-inside-a-session) still carries in-flight work over, and `CLAUDE_DISABLE_ADOPT` turns off both. Requires Claude Code v2.1.196 or later","description_source":"docs","described_by":{"doc":"claude-code\/env-vars","title":"Environment variables"},"presence":{"first_seen":"2.1.196","removed_in":null,"in_current_build":true,"newest_mined":"2.1.308","builds":101,"mined_builds":149,"first_cited":{"version":"2.1.235","released_at":"2026-08-18 18:24:10","spans":1}},"aliases":[],"entries":[{"version":"2.1.235","anchor":"background-exit-handoff-can-be-disabled-by-environment-varia","heading":"Background exit handoff can be disabled by environment variable","line":"CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF now requires the variable to be unset, giving a cleaner escape hatch","released_at":"2026-08-18 18:24:10","reason":"found in this entry's text, named in this entry"},{"version":"2.1.234","anchor":"live-artifact-comment-monitors-carry-across-backgrounding-an","heading":"Live Artifact comment monitors carry across backgrounding and exit","line":"Artifact comment watchers now survive backgrounding and exit, and tell you when one couldn't be resumed.","released_at":"2026-08-17 18:19:13","reason":"found in this entry's text"}],"entries_total":2,"docs":[{"source":"claude-code","path":"env-vars","title":"Environment variables","documented":true},{"source":"claude-code","path":"agent-view","title":"Manage multiple agents with agent view","documented":false}],"docs_total":2,"gates":[],"related":[{"name":"CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP","slug":"claude-code-disable-bg-shell-pressure-reap","description":"Set to `1` to stop Claude Code from terminating [background shell commands](\/docs\/en\/interactive-mode#background-bash-commands) under memory pressure. By default, on macOS and Linux, Claude Code terminates background shells when the operating system reports critical memory pressure and the session has been idle for 30 minutes with no turn or subagent running. Windows has no memory-pressure signal, so this variable has no effect there. Requires Claude Code v2.1.193 or later"},{"name":"CLAUDE_CODE_DISABLE_BG_STABLE_PATH","slug":"claude-code-disable-bg-stable-path","description":"On macOS, setting CLAUDE_CODE_DISABLE_BG_STABLE_PATH makes background sessions relaunch from the running program instead of the stable path"}],"url":"https:\/\/changelogs.core-directive.com\/reference\/env\/claude-code-disable-bg-exit-handoff","family_url":"https:\/\/changelogs.core-directive.com\/reference\/env.json"}