Unclear Which environment variables are added, and which one is removed, is not known.
What
Claude Code sometimes restarts itself, for example on the --resume path. When it opens a folder it has not been told to trust, it shows a trust prompt first, and your home directory has its own version of that prompt.
- On relaunch, Claude Code already set
CLAUDE_BG_WORKSPACE_TRUSTEDto "1". It now also adds a further set of environment variables, which are settings handed to the new process, and removes one more variable first. - If you already accepted the home-directory trust prompt, the old process sets
CLAUDE_CODE_RELAUNCH_HOME_TRUSTto<pid>:<token>. Here pid is the process number and the token comes from a lookup tied to that process. - The new process checks three things: that the pid matches its parent (on Windows, its parent's pid), that a path check passes, and that a fresh lookup with
skipCachereturns the same token. If all three pass, it skipsTrustDialogand treats trust as accepted. - Any value of
CLAUDE_CODE_RELAUNCH_HOME_TRUSTinherited from elsewhere is removed before relaunching.
You do not set this variable yourself. Claude Code sets it internally.
Why
The home-directory trust prompt no longer comes back after Claude Code restarts itself. Because the value is tied to the process and a token, a copy of the variable left in your shell cannot be used to skip the trust prompt.
Which environment variables are added, and which one is removed, is not known.