Claude Desktop Code mode crashes immediately (exit code 1) — works fine from CLI

Status Closed — not planned
Reported on v2.1.85
Maintainer reply None cached
Activity 16 comments · opened Mar 29, 2026 · closed Jun 8, 2026

Summary

Claude Desktop's Code mode (agent mode) crashes immediately with Claude Code process exited with code 1 when starting a session. Chat mode works fine. The same Claude Code binary works perfectly when invoked from the CLI in the same directory.

Environment

  • macOS: Darwin 25.3.0 (Apple Silicon)
  • Claude Desktop: v1.1.9310
  • Embedded Claude Code: v2.1.85
  • CLI Claude Code: v2.1.86

Reproduction

  1. Open Claude Desktop in Code mode (sidebarMode: "code")
  2. Navigate to a project folder (path contains Japanese characters and spaces)
  3. Send any message
  4. Session crashes instantly — no response

This occurs consistently across multiple restarts, sign-out/sign-in cycles, and full cache wipes.

Logs

From ~/Library/Logs/Claude/main.log (paths redacted):

[info] Starting local session local_XXXX in <project_dir>
[info] [CCD] Passing 9 plugin(s) to SDK (skills: 1, remote: 0, local: 8)
[info] Using Claude Code binary at: ~/Library/Application Support/Claude/claude-code/2.1.85/claude.app/Contents/MacOS/claude
[error] Session local_XXXX query error: Claude Code process exited with code 1
[info] [CCD CycleHealth] unhealthy cycle for local_XXXX (2s, hadFirstResponse=false, reason=no_response)

What I've tried (all failed)

  • Sign out / sign in
  • Full cache wipe (Session Storage/, Cache/, IndexedDB/, local-agent-mode-sessions/, bridge-state.json)
  • Multiple app restarts
  • New conversations
  • Check for app updates (latest)
  • Verified the binary runs fine from CLI: claude -p "test" → works
  • Verified with Desktop-like flags (--output-format stream-json --input-format stream-json --verbose --permission-mode bypassPermissions) → works
  • Verified with Desktop-like env vars (CLAUDE_CODE_ENTRYPOINT=claude-desktop, CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST=1, etc.) → works

Key finding

  • Chat mode: works normally
  • Code mode: instant crash (exit code 1), no stderr visible
  • CLI in same directory: works perfectly
  • The Desktop does not expose stderr from the spawned Claude Code process, making it impossible to diagnose further from the user side
  • The issue may be related to Japanese characters in the working directory path — the Desktop's shell wrapper (eval + zsh) may not handle certain CJK path names correctly

Additional issue found during investigation

bridge-state.json persisted a corrupted remote session causing infinite Epoch mismatch (409) loops. Manually resetting this file to {} resolved the chat mode issue, but Code mode remained broken.

View original on GitHub ↗

15 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/37822
  2. https://github.com/anthropics/claude-code/issues/39647
  3. https://github.com/anthropics/claude-code/issues/39270

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

C2N1 · 5 months ago

+1 — Same issue here. Max subscriber, broken for over a week (since March 22).

Root cause confirmed: Desktop App passes flags (--plugins, --sdk-metadata) that the embedded Claude Code binary (2.1.78 / 2.1.87) doesn't recognize → immediate exit code 1. CLI works fine.

Full technical analysis in #40540.

qgeagencia · 4 months ago

+1 — still happening on Claude for Mac 1.3109.0 (35cbf6) with Opus 4.7 1M model. Error "Claude Code process exited with code 1" appears when trying to start any Code-mode conversation, including trivial messages (just typing "claude" and sending). #40540 was closed as resolved but the problem persists on this version. Timestamp: 2026-04-19.

ltwn-dev · 4 months ago

Desktop app version (you’re on 2.1.116)
macOS version (Apple menu → About This Mac)
Exact error: “Claude Code process exited with code 1”
Steps: open Claude Desktop → Claude Code → new session → point to local folder → send “Hi, Let’s start” → it breaks

rwarch · 4 months ago

Additional reproduction data — macOS Tahoe, SDK 2.1.111, persistent since March 26

Environment

  • macOS 26.3.1 (Darwin 25.3.0, arm64)
  • Claude Desktop: latest (updated April 21, 2026)
  • Bundled Claude Code SDK: 2.1.111
  • CLI Claude Code: 2.1.117 (works perfectly)
  • Node: v25.9.0

Symptoms

  • Code tab: instant crash with exit code 1 on every attempt — zero successful sessions ever
  • Cowork tab: works perfectly (runs via VM path)
  • Chat tab: works perfectly
  • CLI: works perfectly

Log evidence (39 occurrences, dating back to March 26)

Crash pattern (~/Library/Logs/Claude/main.log):

[info] LocalSessions.start:
[info] Starting local session local_e33ca7e6-... in /Users/<USERNAME>/Desktop/<PROJECT>
[info] [CCD] Passing 1 plugin(s) to SDK (skills: 1, remote: 0, local: 0)
[info] Using Claude Code binary at: /Users/<USERNAME>/Library/Application Support/Claude/claude-code/2.1.111/claude.app/Contents/MacOS/claude
[error] Session local_e33ca7e6-... query error: Claude Code process exited with code 1
[info] [CCD CycleHealth] unhealthy cycle (0s, hadFirstResponse=false, reason=no_response)

Stack trace:

Error: Claude Code process exited with code 1
    at sIr.getProcessExitError (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:390:8041)
    at ChildProcess.i (/Applications/Claude.app/Contents/Resources/app.asar/.vite/build/index.js:390:11086)
    at Object.onceWrapper (node:events:623:26)
    at ChildProcess.emit (node:events:520:35)
    at ChildProcess._handle.onexit (node:internal/child_process:294:12)

Key observations

  1. Binary works fine when invoked directly: claude-code/2.1.111/claude.app/Contents/MacOS/claude --version2.1.111 (Claude Code)
  2. OAuth succeeds before the crash — not an auth issue
  3. MCP servers all connect successfully before the binary is spawned
  4. The crash is instantaneous (0s, hadFirstResponse=false)
  5. Issue persists across SDK versions: 2.1.78 → 2.1.111, all fail identically
  6. Multiple desktop app updates have not resolved the issue
  7. Reinstalling, restarting, cache clearing — none help

Confirms the SDK flag incompatibility root cause identified in #40540.

dawooddren · 4 months ago

Also hitting this on the latest Desktop build.

Environment

  • Desktop app: Claude 1.3561.0 (fbc74b) 2026-04-20T14:59:51.000Z
  • Bundled Claude Code: 2.1.111
  • CLI (working): 2.1.116 (native install via claude install)
  • macOS: Tahoe 26.4.1 (25E253)
  • Apple Silicon / Intel: 2.4 GHz 8-Core Intel Core i9

What works: Chat mode, Cowork mode, Claude Code from Terminal — all fine.

What doesn't: Code mode in the Desktop app crashes instantly on every message with "Claude Code process exited with code 1." Happens on both existing and new sessions.

Timing: This was working until the 1.3561.0 build landed on April 20.

Key log lines (main.log):

[info] [CCD] Passing 3 plugin(s) to SDK (skills: 1, remote: 2, local: 0)
[info] [CCD] [replaceRemoteMcpServers] Calling SDK with 7 total servers
[error] Session local_xxx query error: Claude Code process exited with code 1
[info] [CCD CycleHealth] unhealthy cycle (0s, hadFirstResponse=false, reason=no_response)

Binary is hit at: /Users/[user]/Library/Application Support/Claude/claude-code/2.1.111/claude.app/Contents/MacOS/claude

The bundled binary works fine when invoked directly from Terminal. The crash occurs the instant the Desktop app spawns it — before any hooks or tools execute.

Troubleshooting attempted (none resolved):

  • Reinstalled CLI via claude install (native)
  • Re-authenticated via claude auth logout / claude auth login
  • Deleted and re-downloaded the cached bundle at ~/Library/Application Support/Claude/claude-code/
  • Started fresh sessions
  • No custom MCP servers configured in claude_desktop_config.json

Config file (claude_desktop_config.json) has no MCP servers — the 7 servers in the log are all internal/injected by the app.

stephenkungfarmbot · 4 months ago

I'm having this issue on my MacBook Pro intel :(

macsinvan · 4 months ago

I have had this same issue for weeks now. This seems like a basic bug that would affect all Mac users, why is it not getting fixed?

tarnsatsarm · 4 months ago

Anthropic — this needs a patch immediately. Not next sprint. Now.

The root cause has been confirmed for over a month in #40540: the Desktop App passes --plugins and --sdk-metadata flags that the embedded Claude Code binary does not recognize, causing immediate exit code 1 on every spawn. The reporter literally wrote: "Nothing fixes it because the issue is in how the Desktop App invokes the embedded binary."

Despite that confirmation, the same bug keeps resurfacing across versions and platforms — #42350, #43164, #44573, #46161, #49041, #49271, #50073, and now #52766. Closing #40540 did not fix it; it just buried the canonical explanation while paying customers keep hitting the same wall.

My situation as a paying Claude Pro user:

  • Three full days lost troubleshooting an environment that was never the problem
  • Three sessions of working context destroyed by a "clear cache" path the UI suggested but never warned would be irreversible
  • A project blocked at a critical phase (active database migration, 10,000+ line diff awaiting review)
  • Forced to fall back to CLI via a hand-edited .bat wrapper because the product I pay for is broken

This is not a minor regression. The Desktop App's primary value proposition — the GUI for Claude Code — has been non-functional on Windows and macOS for multiple weeks, with a known and trivially describable root cause sitting in a closed issue.

What I expect, in priority order:

  1. A hotfix release this week that aligns the Desktop App's spawn flags with the embedded binary's actual flag set. This is a one-line fix on your side. There is no engineering reason it should take a sprint.
  2. A public statement acknowledging the regression, scope, and ETA. Customers should not have to file duplicate bug reports to discover that a known issue is still open.
  3. A rollback option in the Desktop App settings to pin to the last working bundled binary version, so users have agency when this happens again.
  4. A fix to the cache-clear UX that destroyed my session history without warning. "Clear cache" should not silently nuke conversation context with no recovery path.
mrbongiolo · 3 months ago

This is still an issue on the Claude Desktop app for Mac (Claude 1.6259.1 (5095e7) 2026-05-06T03:26:09.000Z)

hjwsm1989 · 3 months ago

meet this on claude desktop app for mac (Claude 1.6608.0 (f65729) 2026-05-07T14:16:09.000Z)

macsinvan · 3 months ago

After an update I was given a more informative error code. Following that I went to System Settings > Privacy and Security > Full disk Access: Switched on the Claude App switch and I was back in business. Hope that works for others

dawooddren · 3 months ago

Still doesn't work for me anymore even though I have given Claude full disk access etc., but I am thinking it is something to do with my target folder being within Dropbox rather than elsewhere on my hard drive (the Code stuff is part of a much larger project and easier to keep all together via Dropbox). Not sure why it worked with no issue until recently but something definitely changed. Code via terminal works just fine, though, so no idea why it does this.

footballfinder · 3 months ago

Still doesn't work for me as well for 3 days.

github-actions[bot] · 2 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

Showing cached comments. Read the full discussion on GitHub ↗