Repository navigation
Description
Summary
I set CLAUDE_CONFIG_DIR in Settings → Environment variables to $HOME/.claude-personal, the way I would write it in a shell. bb passes environment values through literally, so Claude Code treats the value as a relative path. It creates a folder named $HOME inside each thread's workspace, starts with an empty config there, and every turn fails with Not logged in · Please run /login. Neither the editor nor bb machine env set says that values are not expanded. The value field is a password input and saved values are never shown again, so the mistake can't be spotted after saving.
Versions and environment
- bb desktop app 0.45.0 (
desktop-v0.45.0, 129f621), macOS 27.2 (26B5091g), arm64 - Claude Code 2.1.292
- Local primary host only, default data dir and ports
- Code read at
main68a1e8b
Steps to reproduce
Minimal, no provider needed:
printf '%s' '$HOME/bb-repro' | bb machine env set BB_REPRO_DOLLAR --project <proj>printf '%s' '~/bb-repro' | bb machine env set BB_REPRO_TILDE --project <proj>bb terminal create --thread <thread in that project> --json --command 'printf "BB_REPRO_DOLLAR=%s\nBB_REPRO_TILDE=%s\nHOME=%s\n" "$BB_REPRO_DOLLAR" "$BB_REPRO_TILDE" "$HOME"; read -t 20 _'bb terminal output <terminal id>
With Claude Code:
- Settings → Environment variables → All projects:
CLAUDE_CONFIG_DIR=$HOME/.claude-personal, a config dir that is logged in when given as an absolute path. - Start a Claude Code thread in any project and send
hi.
Expected vs actual
Actual, terminal repro:
BB_REPRO_DOLLAR=$HOME/bb-repro
BB_REPRO_TILDE=~/bb-repro
HOME=/Users/pavlos
Actual, Claude Code thread:
Provisioned thread
Provider environment resolved
Unhandled Claude Code event
Not logged in · Please run /login
Not logged in · Please run /login error
ps eww on the spawned claude --output-format stream-json … process shows CLAUDE_CONFIG_DIR=$HOME/.claude-personal. A directory literally named $HOME appeared in every workspace that ran a turn:
~/Source/projects/g2-crosshair/$HOME/.claude-personal
~/Source/clients/<client>/<repo>/$HOME/.claude-<account>
~/.bb/provider-maintenance-workspace/$HOME/.claude-personal
git status in both repos showed ?? $HOME/.
Expected: either bb expands the value the way a shell would, or it tells me when I save that values are used literally and $HOME / ~ are not expanded. Silently creating a config dir inside the repo is the worst outcome. The agent runs logged out, and the folder is easy to commit by accident.
Evidence
- The daemon copies values verbatim into the child environment:
bb/apps/host-daemon/src/operation-environment.ts
Lines 12 to 13 in 68a1e8b
for (const entry of entries) { if (typeof entry.value === "string") env[entry.name] = entry.value; - The editor's value field is
type="password", and saved values only come back asSaved secret · enter to replace:bb/apps/app/src/components/settings/MachineEnvironmentSettings.tsx
Lines 628 to 638 in 68a1e8b
<Input className="min-w-0 pr-9 font-mono" aria-label={`Value for ${row.name || `variable ${index + 1}`}`} type={revealed ? "text" : "password"} placeholder={ row.value === null ? "Saved secret · enter to replace" : "VALUE" } value={row.value ?? ""} autoComplete="off" disabled={disabled} onChange={(event) => onValueChange(event.target.value)} - I found no expansion or validation of values in
apps/cli/src/commands/machine-environment.ts,apps/server/src/services/machines/environment-settings.ts, or the daemon. - Changing the values to absolute paths fixed it: the same terminal check prints
/Users/pavlos/.claude-personal, andclaude auth statuswith thatCLAUDE_CONFIG_DIRreports"loggedIn": true.
What you ruled out
- Not a duplicate of Project-scoped CLAUDE_CONFIG_DIR is ignored when listing a project's provider skills and commands #3925, A provider's declared user skill root is scanned even when its resolver moved that root (CLAUDE_CONFIG_DIR) #3926 or Claude usage check ignores CLAUDE_CONFIG_DIR, reporting expired for a signed-in account #3607. Those cover bb's own listings and usage checks ignoring a valid
CLAUDE_CONFIG_DIR. Here the value itself is never expanded. - Not Claude-specific: arbitrary variable names behave the same in a plain thread terminal (repro above), so
CODEX_HOME,PI_CODING_AGENT_DIRand similar path variables are affected the same way.
Suggested fix
Values are often secrets, and expanding $… inside them would break real tokens that contain $. A warning seems safer than expansion: when a value starts with ~ or contains $NAME / ${NAME}, show a non-blocking note under the row in the editor and on stderr from bb machine env set, for example "Values are used literally. $HOME and ~ are not expanded; use an absolute path." Expanding only a leading ~/ or $HOME/ would also work. I'm happy to implement either one.
Suggested priority and effort
Small change. The workaround is to use absolute paths. No data is lost, but the agent runs logged out and a stray config dir lands in the repo.
Checks
- I reproduced this on the latest release (desktop 0.45.0).
- I searched open and closed issues for the same problem.
- An agent wrote this. It was investigated in a Claude Code session outside bb, so there is no bb thread to link.
AGENT GENERATED
Activity
bb-slop-cop commentedon Oct 7, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilothost,cli,confirmed-repro.origin/main(68a1e8b) in two clean checkouts.pvinis commentedon Oct 7, 2026
happy to do a PR if i am allowed 👍