Repository navigation
Description
Operating system
Windows
Orca version
v1.4.216
Details
Summary
- One line: On Windows + WSL, the active managed Claude account is silently ignored for any project whose path spells the distro with different casing than the account selection (for example
\\wsl.localhost\ubuntu\...vsUbuntu). Those terminals fall back to the WSL system-default Claude login. - Impact: Switching Claude accounts in Settings, in the usage popover, or via "Continue in new session" has no effect in those projects. New Claude sessions keep using the system-default account, and nothing in the UI says the switch was not applied.
- Suggested fix: Compare WSL distro names case-insensitively (Windows treats them that way) when storing and looking up
activeClaudeManagedAccountIdsByRuntime.wsl, or canonicalize the distro parsed from the path against the installed distro list. - Workaround: Re-add the project using the exact distro casing from
wsl.exe -l, or launch Claude manually withCLAUDE_CONFIG_DIRpointing at the managed account directory.
Environment
- Windows host, WSL2 distro named
Ubuntu(this is whatwsl.exe -land the account-location dropdown show) - Account location: WSL → Ubuntu, with three managed WSL Claude accounts
- Claude Code 2.1.28x installed inside WSL
What happens
Most of my projects were added with a lowercase distro segment, e.g. \\wsl.localhost\ubuntu\home\<user>\projects\.... A few were added as \\wsl.localhost\Ubuntu\.... Windows resolves both to the same location, so everything else in Orca works and the difference is invisible.
The managed-account selection is stored under the distro name from the dropdown:
"activeClaudeManagedAccountIdsByRuntime": { "host": null, "wsl": { "Ubuntu": "<managed-account-id>" } }When a Claude terminal is launched in a lowercase-path project, the PTY gets no CLAUDE_CONFIG_DIR, so Claude uses ~/.claude (the system-default login). In an Ubuntu-path project, the same launch gets CLAUDE_CONFIG_DIR=/home/<user>/.local/share/orca/claude-accounts/<managed-account-id>/auth as expected.
Reproduction
- On Windows with a WSL distro named
Ubuntu, add two projects: one via\\wsl.localhost\Ubuntu\home\<user>\repo-a, one via\\wsl.localhost\ubuntu\home\<user>\repo-b. - Settings → AI Provider Accounts → WSL → Ubuntu → add a managed Claude account and make it active.
- Open a new Claude terminal in each project and run
echo $CLAUDE_CONFIG_DIR(or/statusinside Claude).
Expected: both terminals use the managed account.
Actual: only the Ubuntu project does. The ubuntu project gets no CLAUDE_CONFIG_DIR and runs under the system-default account.
Controlled A/B check
I ran this at the same moment, with the same active selection ({"Ubuntu": "<managed-account-id>"}). The command contains the claude token so Orca treats it as a Claude launch:
orca terminal create --worktree 'id:<repo-a-id>::\\wsl.localhost\Ubuntu\home\<user>\repo-a' \
--command ": claude ; printenv CLAUDE_CONFIG_DIR > /tmp/ab-upper.txt; echo rc=\$? >> /tmp/ab-upper.txt; exit"
orca terminal create --worktree 'id:<repo-b-id>::\\wsl.localhost\ubuntu\home\<user>\repo-b' \
--command ": claude ; printenv CLAUDE_CONFIG_DIR > /tmp/ab-lower.txt; echo rc=\$? >> /tmp/ab-lower.txt; exit"Result:
ab-upper.txt: /home/<user>/.local/share/orca/claude-accounts/<managed-account-id>/auth
rc=0
ab-lower.txt: rc=1 # CLAUDE_CONFIG_DIR not set
The same happens with "Continue in new session": the new tab in the lowercase project had all the ORCA_* launch variables (ORCA_AGENT_LAUNCH_TOKEN, ORCA_PANE_KEY, and so on) but no CLAUDE_CONFIG_DIR, and /status inside it showed the system-default account.
Where it seems to come from
This is based on reading the bundled main process of v1.4.216, so the names below are my readable reconstruction:
// Launch target for a PTY: the distro is parsed from the cwd UNC path as written
function resolveClaudeLaunchTarget(shellOverride, cwd, expectedWslDistro) {
const wsl = parseWslUncPath(cwd) // "\\wsl.localhost\ubuntu\..." -> { distro: "ubuntu" }
return isWslShell(shellOverride) || wsl
? { runtime: "wsl", wslDistro: wsl?.distro ?? expectedWslDistro ?? null }
: { runtime: "host" }
}
function normalizeDistroKey(d) { return d?.trim() || null } // trim only, no case folding
function getActiveClaudeAccountId(settings, target) {
const sel = settings.activeClaudeManagedAccountIdsByRuntime
if (target.runtime === "host") return sel.host
if (target.wslDistro) return sel.wsl[normalizeDistroKey(target.wslDistro) ?? "__default__"] ?? null
// ...fallback to "__default__" / the single selected account only when no distro is known
}sel.wsl["ubuntu"] is undefined, so the lookup returns null. getPreparation() then takes the WSL system-default branch (envPatch: {}), and no CLAUDE_CONFIG_DIR is injected.
Switching the account-location dropdown to "WSL default" does not help. Once a distro name is parsed from the path, the lookup never consults the __default__ key. In my case the stored selection also stayed {"Ubuntu": ...}.
Suggested fix
- Normalize WSL distro keys case-insensitively on both write and read, e.g.
d?.trim().toLowerCase(), and migrate existing keys. - Alternatively, canonicalize the distro parsed from a UNC path to the installed distro's real name (from
wsl.exe -l) before any lookup. - Consider surfacing a hint when a Claude launch resolves to "system default" while a managed account is selected for that runtime. At the moment the failure is completely silent.
The Codex selection (activeCodexManagedAccountIdsByRuntime) is keyed the same way ({"Ubuntu": ...}), so it may be affected too. I have not verified that.
Related
- [Bug]: WSL account switching replaces the entire CLAUDE_CONFIG_DIR profile (host runtime does an auth-only swap) — switched sessions lose settings, plugins, statusline #11824: WSL account switching replaces the whole
CLAUDE_CONFIG_DIRprofile. Once this bug is fixed, those sessions will also hit that problem. - [Bug]: Managed Claude accounts do not appear in WSL account manager after successful login #17089: managed WSL Claude accounts not appearing after login. In my setup, adding a WSL account initially failed with "Claude login completed, but no OAuth credentials were captured". The cause was that the login runs through
wsl.exe ... bash -lc "export CLAUDE_CONFIG_DIR=...; exec claude auth login". In a non-interactive login shell, nvm is not loaded, soclauderesolved to the Windows npm shim on the interop PATH (/mnt/c/Users/<user>/AppData/Roaming/npm/claude→claude.exe). The Windows binary never receives the LinuxCLAUDE_CONFIG_DIR(it is not inWSLENV), so it wrote the credentials to the Windows%USERPROFILE%\.claudeinstead. Putting a Linuxclaudeon the login-shell PATH (~/.local/bin/claude) fixed account adding. This may be worth checking for [Bug]: Managed Claude accounts do not appear in WSL account manager after successful login #17089.
Activity