Claude Code Desktop: New sessions fail with "Setup script failed with exit code 1" — existing sessions unaffected
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?
Environment:
- Claude Desktop App: 1.1.9493
- Claude Code CLI: 2.1.87
- macOS: 26.3.1 (Tahoe)
- Chip: Apple M4
- Node: v25.8.1
Description:
New Claude Code sessions in the desktop app consistently fail with "Setup script failed with exit code 1."
Existing/older sessions continue to work normally. The issue has persisted since March 23, 2026 — nearly a week now.
Steps to reproduce:
- Open Claude desktop app
- Start a new Claude Code session (any project directory)
- Session fails immediately with "Setup script failed with exit code 1"
What I've tried (none of these fixed it):
- Reinstalled Claude Code CLI (npm install -g @anthropic-ai/claude-code)
- Cleared all Claude Code caches (~/Library/Application Support/Claude/claude-code, claude-code-vm, vm_bundles, Cache,
GPUCache)
- Completely uninstalled and reinstalled Claude desktop app via Homebrew
- Logged out and logged back in
- Killed and relaunched the app multiple times
Log analysis:
The VM boots and connects successfully — all backend logs (cowork_vm_node.log, coworkd.log, main.log) show clean
startup with no errors. The SDK installs correctly. The problem is in the web frontend.
claude.ai-web.log shows a recurring pattern on every new session attempt:
[REACT_QUERY_CLIENT] QueryClient error: Error: Not found
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'includes')
The QueryClient fetch returns "Not found", and subsequent code calls .includes() on the undefined result, crashing the
session init.
Additionally, a Content Security Policy error appears:
Connecting to 'https://a-api.anthropic.com/v1/m' violates the following Content Security Policy directive:
"connect-src 'self' https://api.segment.io ..."
Timeline:
- First occurrence: 2026-03-23 14:20:55
- Latest occurrence: 2026-03-29 15:06:40
- Ongoing for ~6 days with no resolution
Key observation:
- Old/existing sessions work fine
- Only new session creation is broken
- Fresh app reinstall does not fix it, suggesting a server-side or account-level issue
- CLI (claude in terminal) works perfectly
What Should Happen?
When clicking "New Session" or starting a new Claude Code conversation in the desktop app, it should initialize successfully and present an interactive prompt ready for input.
Error Messages/Logs
From ~/Library/Logs/Claude/claude.ai-web.log (repeating since 2026-03-23):
[REACT_QUERY_CLIENT] QueryClient error: Error: Not found
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'includes')
Also present:
Connecting to 'https://a-api.anthropic.com/v1/m' violates the following Content Security Policy directive:
"connect-src 'self' https://api.segment.io https://*.segment.io https://*.segment.com https://a-cdn.anthropic.com
https://*.google.com https://*.facebook.com https://*.facebook.net https://*.doubleclick.net". The action has been
blocked.
Fetch API cannot load https://a-api.anthropic.com/v1/m. Refused to connect because it violates the document's Content
Security Policy.
Error sending segment performance metrics TypeError: Failed to fetch
Note: All backend/VM logs are clean. VM boots, SDK installs, network connects, API is reachable. The failure is entirely in the web frontend layer.
Steps to Reproduce
- Open Claude desktop app (v1.1.9493)
- Click to start a new Claude Code session (any directory)
- Session fails with "Setup script failed with exit code 1"
- Existing/older sessions continue to work normally
Troubleshooting already attempted (none resolved it):
- Reinstalled Claude Code CLI via npm
- Cleared ~/Library/Application Support/Claude/claude-code, claude-code-vm, vm_bundles, Cache, GPUCache
- Completely uninstalled and reinstalled Claude desktop app (via brew install --cask claude)
- Logged out and back in
- Killed and relaunched app multiple times
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
Unsure of exact version. Issue first appeared on 2026-03-23. App was working before that date.
Claude Code Version
2.1.87 (Claude Code)
Platform
Other
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
- The bug has been active for 6 days (first error: 2026-03-23 14:20:55, latest: 2026-03-29 15:06:40)
- ONLY new sessions are affected — existing sessions work fine
- The CLI (running
claudein terminal) works perfectly, confirming this is a desktop app frontend issue - The VM backend is fully healthy: boots in ~13s, SDK installs, network connects, API reachable
- The root cause appears to be a React QueryClient fetch returning "Not found", after which code calls .includes() on
the undefined result
- A fresh app reinstall did not fix it, suggesting the issue is server-side or account-level rather than a local
corruption
- Node v25.8.1, npm via Homebrew on Apple Silicon
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗