[Bug]: Provider probe runs with the server's cwd, so $HOME/.claude/settings.json is loaded as project settings and breaks CLAUDE_CONFIG_DIR isolation #8818
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/server
Steps to reproduce#
Setup: two Claude provider instances with separate CLAUDE_CONFIG_DIR paths, per docs/user/providers-claude.md:
- default
~/.claude= managed Bedrock install (IT-installedsettings.jsonwithCLAUDE_CODE_USE_BEDROCK=1,awsAuthRefresh,otelHeadersHelper) ~/Developer/XXFAST/.claude= personal Max OAuth login
- Log the second config dir in with a Max account.
CLAUDE_CONFIG_DIR=~/Developer/XXFAST/.claude claude auth statusshowsloggedIn: true, subscriptionType: max, apiProvider: firstParty. - Point a Claude provider at that config dir in T3 settings.
- Let the periodic provider status check run a few times.
Expected behavior#
The provider shows Authenticated · Claude Max with the account email, consistently. CLAUDE_CONFIG_DIR isolation should hold for the probe.
Actual behavior#
The personal provider shows Authenticated · Amazon Bedrock, and every few minutes flaps to Could not verify Claude authentication status from initialization result. (which disables the model selector) until a restart or manual refresh.
Root cause#
probeClaudeCapabilities runs with cwd from ServerConfig (ClaudeDriver.ts: const { cwd } = yield* ServerConfig). On the macOS desktop app the server's cwd is the user's home directory (verified with lsof -a -p <pid> -d cwd).
Claude Code loads <cwd>/.claude/settings.json as project settings. With cwd = $HOME, that file is ~/.claude/settings.json, the managed Bedrock config. Project settings apply on top of CLAUDE_CONFIG_DIR, so the probe of the personal instance:
- auths as Bedrock (
CLAUDE_CODE_USE_BEDROCK=1wins over the OAuth login in the isolated config dir), hence the wrongAmazon Bedrocklabel, and - inherits the managed install's startup cost:
otelHeadersHelpertiming out (~10s) +awsAuthRefreshcredential process (~6s per call). Init lands at ~25s, racingCAPABILITIES_PROBE_TIMEOUT_MS = 25_000exactly. Under the wire you get the mislabeled "Authenticated", over it you get "Could not verify". Server traces showcheckClaudeProviderStatusspans at 25,034ms.
Measured with a standalone repro of the probe (same SDK, same buildClaudeCapabilitiesProbeQueryOptions):
| cwd | result | time |
|---|---|---|
| inside the project tree | Claude Max · firstParty, correct email | 0.85s |
$HOME | apiProvider: bedrock or 25s timeout | ~25s |
Repro script (node probe.mjs <configDir> <cwd>):
import { query } from "@anthropic-ai/claude-agent-sdk";
const abort = new AbortController();
async function* emptyPrompt() {
await new Promise((resolve) => abort.signal.addEventListener("abort", resolve));
}
const q = query({
prompt: emptyPrompt(),
options: {
persistSession: false,
abortController: abort,
settingSources: ["user", "project", "local"],
settings: JSON.stringify({ disableAllHooks: true }),
allowedTools: [],
mcpServers: {},
strictMcpConfig: true,
env: { ...process.env, CLAUDE_CONFIG_DIR: process.argv[2], ENABLE_CLAUDEAI_MCP_SERVERS: "false" },
cwd: process.argv[3],
stderr: () => {},
},
});
const t = setTimeout(() => { console.log("TIMEOUT 25s"); abort.abort(); process.exit(2); }, 25_000);
const init = await q.initializationResult();
clearTimeout(t);
console.log(JSON.stringify(init.account ?? null));
abort.abort();
process.exit(0);
Suggested fix#
Run the capability probe with a neutral cwd (the resolved config dir, or os.tmpdir()) instead of the server's cwd, so <cwd>/.claude/settings.json can't leak another environment's auth into an isolated instance. The claude auth status fallback proposed in #4928 would also make the flapping cheaper to avoid (that command returns in ~1s against the same config dirs).
Impact#
Major degradation or frequent failure
Version or commit#
T3 Code 0.0.36 (desktop, macOS)
Environment#
macOS (Darwin 25.4.0), Claude Code 2.1.251 (homebrew cask), Max OAuth in the isolated config dir, managed Bedrock install in default ~/.claude.
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Note
🤖 Claude Opus 5.5 responding on behalf of Theo
Thanks for the report. This is fixed on main in #19320. Please test on the nightly built from main on 2026-10-21, or on the next stable release. If the problem still occurs there, please open a new issue that links to this one, with your version and steps to reproduce it.