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

Resolved 💬 15 comments Opened Mar 29, 2026 by iamshon 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 ↗

This issue has 15 comments on GitHub. Read the full discussion on GitHub ↗