[Bug]: Windows: Claude provider says "`claude` was not found on PATH" for npm-installed Claude Code, although PATH and T3's own lookup are fine
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- On Windows, install Claude Code with npm:
npm i -g @anthropic-ai/claude-code. This creates%APPDATA%\npm\claude.cmd, which runsnode_modules\@anthropic-ai\claude-code\bin\claude.exe. - Confirm a new terminal can run
claude --version(prints2.1.312 (Claude Code)). - Launch T3 Code from the Start menu, leaving Claude's binary path at the default
claude. - Open onboarding → Agents (or Settings → Providers).
- Fully quit T3 (all processes) and relaunch. Same result.
Expected behavior
Claude is detected, as it is in any new terminal.
Actual behavior
Claude shows "Not found · Claude Agent CLI (claude) was not found on PATH." Codex, which is a native codex.exe on PATH, shows Ready.
server.trace.ndjson shows every Claude check failing the same way (7 checks between 12:51 and 13:14 local time, including after a full relaunch):
runClaudeCommand → PlatformError: NotFound: ChildProcess.spawn (claude --version)
The spawned command is the bare name claude with arguments --version. So resolveSpawnCommand returned the name unresolved, and Node can't spawn a .cmd file without its path. caches/claudeAgent.json has "installed": false.
What I ruled out
- The environment. I read the live server process's environment directly, and also through Node's inspector in the running server.
process.platformiswin32,PATHcontains%APPDATA%\npm, andPATHEXTincludes.CMD. - The lookup code. I copied
resolveSpawnExecutableWithNodeand its helpers unchanged frombinCli-C12fvdZY.mjsand ran them under T3's own Electron with the live server's exact environment. They return%APPDATA%\npm\claude.CMD. Running that throughcmd.exethe same wayresolveSpawnCommanddoes prints2.1.312 (Claude Code). - The server as a whole. I ran the unmodified
server.asar/apps/server/dist/bin.mjsmyself in two ways: withserve, and the desktop's way, with--bootstrap-fd 3(modedesktop,shellEnvironmentPrepared: true,resourceMonitorPathset). Both used the live server's exact environment and a fresh base directory. Each timerunClaudeCommandsucceeded and the cache recorded"installed": true, "version": "2.1.312". - Saved settings. This is a fresh install.
statev2.sqlitecontains no provider settings, and the check is reached through the normal path:ProviderInstanceRegistry.buildEntry → ClaudeDriver.create → makeManagedServerProvider → refreshSnapshot → checkClaudeProviderStatus → runClaudeCommand.
So the same code, environment and launch arguments work when I start the server myself, but the server the desktop app starts consistently skips the lookup. I didn't find the cause. One thing I didn't test: running against a copy of the real %USERPROFILE%\.t3 base directory, which I skipped to avoid duplicating the environment ID, secrets and sign-in tokens.
Related, but not the same:
- #7360: on Windows, every provider is reported missing. Here PATH is correct and Codex is found; only the npm
.cmdlauncher fails. - #24293: pnpm-installed Claude fails at the Agent SDK step after the version check passes. Here the version check itself fails.
- #28890: a desktop launch skips the server's own
fixPath. Possibly related, but here the live server's PATH is correct.
Impact
Claude can't be used in T3 on Windows when Claude Code is installed through npm, without a manual binary path.
Version or commit
T3 Code (Beta) 0.1.6 desktop app (Electron 44.10.0). Not yet tested on 0.1.7 nightly; packages/shared/src/shell.ts has changed since 0.1.6 (#28556, #7295).
Environment
Windows 11 Pro 10.0.26200; Claude Code 2.1.312 installed with npm (global)
Logs or stack traces
PlatformError: NotFound: ChildProcess.spawn (claude --version)
at systemError (.../server.asar/apps/server/dist/binCli-C12fvdZY.mjs:6070:34)
at toPlatformError (.../binCli-C12fvdZY.mjs:135971:53)
at ChildProcess.<anonymous> (.../binCli-C12fvdZY.mjs:136169:18)
at snapshotProbe.spawnAndCollect (.../binCli-C12fvdZY.mjs:204333:16)
at runClaudeCommand (.../binCli-C12fvdZY.mjs:204365:30)
at checkClaudeProviderStatus (.../binCli-C12fvdZY.mjs:204635:114)
Expected workaround (untested): set Claude's binary path to the full ...\npm\node_modules\@anthropic-ai\claude-code\bin\claude.exe path.
Thanks for the detailed report. I checked this against current main (dd6c05e), and I couldn't reproduce it from the code or the tests.
- The Claude version probe on main is the same as in v0.1.6 (
runClaudeCommand, thenresolveSpawnCommand). With no instance environment variables, it reads the server's liveprocess.env. - In
packages/shared, the resolver tests pass on main, including the Windows.cmdshim case. - A bare
claudein the error means the PATH/PATHEXT lookup returned nothing for the env it was given. Your own server runs with a fresh base directory succeeded, so the remaining difference is the real.t3base directory.
Provider settings are stored in %USERPROFILE%\.t3\userdata\settings.json, not in statev2.sqlite. Could you share:
- The Claude-related part of that
settings.json(theclaudeAgentprovider entry and any provider instances with anenvironmentlist). Redact the values but keep the variable names. - Whether your manual
bin.mjsrun fails once you copy only thatsettings.jsoninto the fresh base directory. That leaves out the environment ID, secrets and sign-in tokens. - Whether 0.1.7 nightly still shows "not found".
Update: not a T3 bug, closing. Sorry for the noise.
What went wrong: Claude Code had been installed with npm i -g from a terminal running inside the Claude desktop app. On Windows that app is an MSIX package. Windows redirects a packaged app's writes under %APPDATA% into the package's private storage, so npm's files went to %LOCALAPPDATA%\Packages\Claude_<id>\LocalCache\Roaming\npm instead of the real %APPDATA%\npm.
Processes inside that package see the private copy merged into %APPDATA%\npm. Everything else, including T3 and normal terminals, sees a %APPDATA%\npm without claude. That is why T3 reported "not found", and why even an absolute binaryPath to claude.exe failed with ENOENT. All my "works when I run it" tests were launched from inside the same package, so they saw the private copy. That made the evidence in this issue misleading.
I confirmed it from inside the live T3 server through the Node inspector: fs.existsSync('%APPDATA%\npm\claude.cmd') was false, while the same check from inside the Claude app was true.
Fix: reinstall from a normal terminal, outside the packaged app (npm i -g @anthropic-ai/claude-code), and delete the private copy under ...\LocalCache\Roaming\npm. T3 then detects Claude with the default claude binary path, with no changes to T3.
Might other users hit this? Possibly. Anyone on Windows who installs a provider CLI under %APPDATA% (npm, pnpm and so on) from a terminal or agent inside an MSIX-packaged app will get the same "not found" in T3, even though the CLI works in that app. If you see other Windows "not found on PATH" reports where the user says the CLI works fine, checking %LOCALAPPDATA%\Packages\*\LocalCache\Roaming for it may be worthwhile.
Thanks for tracking down the cause. It explains why T3 got ENOENT even for an absolute binaryPath: an npm global install made from a terminal inside the MSIX-packaged Claude desktop app goes to %LOCALAPPDATA%\Packages\Claude_<id>\LocalCache\Roaming\npm, and only processes inside that package can see it. Reinstalling from a normal terminal fixes it without any change to T3, so this stays closed as not a T3 bug. We'll keep the LocalCache\Roaming check in mind for other Windows "not found on PATH" reports where the CLI works elsewhere.