{"version":"2.1.281","anchor":"background-session-child-environment-auth-and-new-variables","canonical_anchor":"background-session-child-environment-auth-and-new-variables","heading":"Background-session child environment: auth and new variables handled explicitly","tier":"internal","area":"Sessions","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.281\/e\/background-session-child-environment-auth-and-new-variables","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.281","markdown":"### Background-session child environment: auth and new variables handled explicitly\n\nBackground sessions now start from a cleaned environment, with login variables added back and some internal variables left out\n\n**Unclear.** The finding does not name the host login variable or say what the check before restoring it tests.\n\n**What**\n\nClaude Code can start other sessions that run in the background. Environment variables are named settings a program receives when it starts, and the ones given to those sessions are now prepared differently. The list starts from a cleaned base, and then:\n\n- `CLAUDE_CODE_OAUTH_TOKEN` and the host's login variable are copied back from the current environment, after a check.\n\n- `CLAUDE_BG_SESSION_PERMISSION_RULES` is left out.\n\n- `CLAUDE_BG_MEMORY_TOGGLED_OFF` is left out.\n\n- `CLAUDE_CODE_HOST_GATEWAY_LINEAGE` is left out when a host-managed provider is in use.\n\nNew internal code writes and reads \"gateway\" and \"lineage\" markers through `CLAUDE_CODE_USE_GATEWAY` and `CLAUDE_CODE_HOST_GATEWAY_LINEAGE`. A record the host writes when a session ends now includes content.\n\n**Why**\n\nBackground sessions keep your login but no longer inherit permission rules or memory settings meant for the session that started them.\n\n- Area: Sessions\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 2\/5"}