On macOS, Claude Code sometimes relaunches itself when it starts a background session, which is a session that keeps running without you watching it. This relaunch is tied to macOS privacy permissions. Before, it always used a fixed, stable location for the Claude Code program when one was available.
It now uses the program that is currently running instead when either of these environment variables is set (an environment variable is a setting you give a program from your shell before starting it):
CLAUDE_CODE_DISABLE_BG_STABLE_PATH, set to any valueCLAUDE_PTY_HOST_NO_STABLE_PATH, set to1
The relaunched program does not inherit CLAUDE_PTY_HOST_NO_STABLE_PATH.
If background sessions fail to start because of the stable program location, these settings give you a way around it.