{"version":"2.1.326","anchor":"new-env-vars-for-child-sessions-are-scrubbed-and-cleared","canonical_anchor":"new-claude-code-child-notes-dir-env-var-is-created-by-one-pr","heading":"New CLAUDE_CODE_CHILD_NOTES_DIR and related variables passed to child sessions","tier":"notice","area":"Environment","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.326\/e\/new-env-vars-for-child-sessions-are-scrubbed-and-cleared","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.326","markdown":"### New CLAUDE_CODE_CHILD_NOTES_DIR and related variables passed to child sessions\n\nClaude Code can create a private notes folder per session and pass it to child sessions as `CLAUDE_CODE_CHILD_NOTES_DIR`, alongside new launcher variables\n\n**What**\n\nAn environment variable is a named value a program receives from whatever started it. A child session is a copy of Claude Code started by another session. Three new environment variables appear in this build.\n\n- `CLAUDE_CODE_CHILD_NOTES_DIR`: a session can create a private folder for itself, readable only by your user account (mode 0700). It hands the folder's path to the child sessions it launches only when the folder was created safely. A child accepts the inherited path only if it is a full path, ends with the expected folder name, sits under a recognised parent folder and is not a symbolic link, which is a shortcut to another location.\n\n- `CLAUDE_CODE_LAUNCHED_BY_SESSION_IDS`: the launcher passes this along with the notes folder.\n\n- `CLAUDE_CODE_WITHHOLD_PRODUCT_EVENTS`: this is cleared when the environment for background services is set up.\n\n- Cleanup: `CLAUDE_CODE_LAUNCHED_BY_SESSION_IDS` and `CLAUDE_CODE_CHILD_NOTES_DIR` are removed from the environment a process inherits. The notes folder variable also appears on several lists of allowed and blocked variables, where one list deletes it and another skips it.\n\n- Child launch: for child sessions that are not display-only, the launcher now adds an extra set of variables based on the session id, next to `CLAUDE_CODE_CHILD_SESSION` and `CLAUDE_CODE_SESSION_ATTENDED`.\n\n**Why**\n\nA parent session now has a way to give the child sessions it starts a notes folder. If you or a wrapper script clean up or inspect the environment, you will see these variables appear.\n\n- Area: Environment\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: no"}