Disclaimer: this issue was investigated and drafted with the assistance of an AI coding agent.
Summary
On Windows, ucode configure crashes with FileNotFoundError: [WinError 2] The system cannot find the file specified when it shells out to claude (or npm) via subprocess.run([...]). The subprocess call uses a bare command name ("claude", "npm"), which resolves to claude.cmd / npm.cmd when those tools are installed via npm. Python's subprocess.run (without shell=True) calls CreateProcess, which only appends .exe and does not honor PATHEXT — so .cmd/.ps1 shims are never found, even when where claude / where npm succeed in the shell.
Additionally, _register_web_search_mcp in claude.py only catches RuntimeError around remove_claude_mcp_server, so the FileNotFoundError propagates and crashes the whole configure run instead of being treated as best-effort cleanup.
Environment
- OS: Windows (cmd.exe)
- ucode installed via
uv tool install
- Python: uv-managed CPython 3.14.6 (bundled with the ucode tool)
claude and codex installed via npm install -g (i.e. present as claude.cmd / codex.cmd)
- Databricks CLI >= v1.0.0
Affected call sites
ucode/mcp.py:140 — subprocess.run(["claude", "mcp", "remove", name, "-s", scope], ...)
ucode/agents/__init__.py:217 — subprocess.run(["npm", "install", "-g", package], ...)
ucode/agents/claude.py:277 / 362 — _register_web_search_mcp only guards against RuntimeError, not FileNotFoundError
Repro
- On Windows, install
claude and codex via npm install -g (so they exist as .cmd).
- Run
ucode configure --agents codex,claude.
- Auth completes, then it crashes at
remove_claude_mcp_server with FileNotFoundError: [WinError 2].
(Same class of failure hits the npm install -g path in install_tool_binary when the agent binary isn't already present.)
Traceback
...
File "ucode\mcp.py", line 140, in remove_claude_mcp_server
subprocess.run(["claude", "mcp", "remove", name, "-s", scope], ...)
...
FileNotFoundError: [WinError 2] The system cannot find the file specified
Disclaimer: this issue was investigated and drafted with the assistance of an AI coding agent.
Summary
On Windows,
ucode configurecrashes withFileNotFoundError: [WinError 2] The system cannot find the file specifiedwhen it shells out toclaude(ornpm) viasubprocess.run([...]). The subprocess call uses a bare command name ("claude","npm"), which resolves toclaude.cmd/npm.cmdwhen those tools are installed via npm. Python'ssubprocess.run(withoutshell=True) callsCreateProcess, which only appends.exeand does not honorPATHEXT— so.cmd/.ps1shims are never found, even whenwhere claude/where npmsucceed in the shell.Additionally,
_register_web_search_mcpinclaude.pyonly catchesRuntimeErroraroundremove_claude_mcp_server, so theFileNotFoundErrorpropagates and crashes the wholeconfigurerun instead of being treated as best-effort cleanup.Environment
uv tool installclaudeandcodexinstalled vianpm install -g(i.e. present asclaude.cmd/codex.cmd)Affected call sites
ucode/mcp.py:140—subprocess.run(["claude", "mcp", "remove", name, "-s", scope], ...)ucode/agents/__init__.py:217—subprocess.run(["npm", "install", "-g", package], ...)ucode/agents/claude.py:277/362—_register_web_search_mcponly guards againstRuntimeError, notFileNotFoundErrorRepro
claudeandcodexvianpm install -g(so they exist as.cmd).ucode configure --agents codex,claude.remove_claude_mcp_serverwithFileNotFoundError: [WinError 2].(Same class of failure hits the
npm install -gpath ininstall_tool_binarywhen the agent binary isn't already present.)Traceback