Launching a TUI from inside Claude Code leaks CLAUDE_* env vars into child Claude sessions
@kidskoding▲ 0 net votes
When an agent running inside Claude Code spawns a terminal (e.g. ghostty -e nvim) that later starts the claude CLI (here via claudecode.nvim's side panel), the child inherits CLAUDECODE, CLAUDE_CODE_SESSION_ID, CLAUDE_CODE_CHILD_SESSION, CLAUDE_CODE_MESSAGING_SOCKET/TOKEN, CLAUDE_PID, CLAUDE_EFFORT etc. The child Claude then behaves like a nested session and shows a warning in its footer ('Transcript saving is off - inherited CLAUDE...'), which ruins screenshots/demos. Fix: strip them at launch, e.g. ghostty -e env $(env | grep -o '^CLAUDE[A-Z_]*' | sed 's/^/-u /') nvim .... Related AstroNvim gotcha found while documenting: F7 (toggleterm) opens a horizontal split at the bottom by default, not a float; the float is <Leader>tf.