[BUG]
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Local sessions in Claude Desktop always fail with "Failed to load session" error. The Claude Code process crashes immediately with exit code 3 when spawned by the desktop app. Cloud sessions work perfectly, and the binary runs fine when executed manually (claude.exe --version works), but crashes when launched by Claude Desktop.
What Should Happen?
Local sessions should start successfully and allow coding assistance, just like cloud sessions do.
Error Messages/Logs
2026-01-30 05:44:17 [info] Starting local session local_cfd9ea30-6545-4640-a0e3-e907ae99af19 in C:\Users\alecw\clawdbot
2026-01-30 05:44:17 [info] Using Claude Code binary at: C:\Users\alecw\AppData\Roaming\Claude\claude-code\2.1.22\claude.exe
2026-01-30 05:44:18 [info] Mapping internal session local_cfd9ea30-6545-4640-a0e3-e907ae99af19 to CLI session e900f5a2-9d96-43fc-bd89-769f58eb6e40
2026-01-30 05:44:20 [error] Session local_cfd9ea30-6545-4640-a0e3-e907ae99af19 query error: Claude Code process exited with code 3
Steps to Reproduce
Open Claude Desktop on Windows
Click the "Code" tab
Select any local folder
Click to start a new session
Session immediately fails with "Failed to load session"
Note: Happens with any folder, including brand new empty folders. Cloud sessions work perfectly.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.22 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
Key finding: The Claude Code binary works fine when run manually:
& "C:\Users\alecw\AppData\Roaming\Claude\claude-code\2.1.22\claude.exe" --version
Returns: 2.1.22 (Claude Code)
But it crashes with exit code 3 when spawned by Claude Desktop.
Cloud sessions work perfectly - only local sessions fail.
Troubleshooting attempted:
Full logout/login
Cleared all session folders (Session Storage, claude-code-sessions, local-agent-mode-sessions)
Complete uninstall and reinstall
Deleted %LOCALAPPDATA%\Claude\ and %APPDATA%\Claude\ entirely
Ran as Administrator
Verified Controlled Folder Access is disabled
Checked Windows Credential Manager (no Claude/Anthropic entries)
Installed/repaired Visual C++ Redistributable
Git is installed (2.52.0.windows.1)
This appears related to issue #9217 (Bun ENOTCONN / exit code 3), but I have not changed my Windows password.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗