[BUG] Windows MSIX: node-pty fails to spawn shell — 'Error: File not found:' in windowsPtyAgent.js (terminal panel broken)
Environment
- Claude version: 1.4758.0.0 (MSIX, x64, Windows Store / winget)
- OS: Windows 11
- Git Bash: C:\Program Files (x86)\Git\bin\bash.exe
Problem
The terminal panel in the Claude desktop app fails to spawn any shell (PowerShell or bash). Clicking the terminal button does nothing visible — no panel opens.
Exact error from %APPDATA%\Roaming\Claude\logs\main.log
2026-04-25 21:54:46 [info] LocalSessions.startShellPty: sessionId=local_4bfcaafa-ae6b-4681-bcd9-eeab7eb9f792, cols=60, rows=49
2026-04-25 21:54:46 [error] Failed to spawn shell powershell.exe for session local_4bfcaafa-ae6b-4681-bcd9-eeab7eb9f792 {
error: Error: File not found:
at new WindowsPtyAgent (C:\Program Files\WindowsApps\Claude_1.4758.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\node_modules\node-pty\lib\windowsPtyAgent.js:81:36)
at new WindowsTerminal (C:\Program Files\WindowsApps\Claude_1.4758.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\node_modules\node-pty\lib\windowsTerminal.js:51:24)
at spawn (C:\Program Files\WindowsApps\Claude_1.4758.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\node_modules\node-pty\lib\index.js:29:12)
at cTn.startShellPty (C:\Program Files\WindowsApps\Claude_1.4758.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index.js:6177:7690)
at async Object.startShellPty (...index.js:6303:6744)
The error File not found: has an empty path — meaning the file argument passed to WindowsPtyAgent is empty string or unresolvable.
Key observations
app.asar.unpacked\node_modules\node-pty\build\Release\exists and contains all expected files:conpty.node,conpty_console_list.node,pty.node,winpty-agent.exe,winpty.dll- The binaries are correctly unpacked — the issue is path resolution inside the asar, not missing files
powershell.exeis accessible:C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exeexists and is in PATH- Terminal worked correctly on 2026-04-19 and 2026-04-20 (confirmed in main.log via successful
startShellPtyentries with no errors) - Broke on 2026-04-25 — likely after an auto-update or Windows Update between those dates
- Force-reinstall via
winget install Anthropic.Claude --forcedid not fix the issue
Hypothesis
windowsPtyAgent.js:81 resolves the shell/agent path using __dirname or a related construct. Inside the MSIX-packaged .asar, __dirname may resolve to the virtual asar path rather than the real filesystem path — making the constructed path to either winpty-agent.exe or the shell executable empty/invalid. Electron's asar path remapping works for require() but not for explicit path.join(__dirname, ...) + fs.existsSync() usage.
This is regression — it worked previously on the same machine and same MSIX packaging model.
Related issues
- #41546 — spawn UNKNOWN on LocalSessions start
- #51886 — CLAUDE_CODE_GIT_BASH_PATH not reaching MSIX child process
Additional context
Also present (but separately fixed by clearing Windows ReadOnly attribute from ~/.claude subtree):
EEXIST: file already exists, mkdir 'C:\Users\marcu\.claude\plugins\data\context-mode-context-mode'on every SessionStart/PostToolUse hook — caused by ReadOnly attribute on~/.claude/pluginsand~/.claude/session-envdirectories (13 000+ subdirs affected)
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗