[BUG] Desktop app passes invalid --session-id ("local_" prefix) to bundled binary — all new Code-mode sessions crash with exit code 1 (regression since May 9 app.asar update)
Summary
After the Claude Desktop app.asar update on May 9, 2026, every new Code-mode session crashes immediately with Claude Code process exited with code 1. Sessions created before the update continue to work. The root cause is a regression in the CCD code: when spawning a new session the desktop passes --session-id "local_<uuid>" (including the local_ prefix) to the bundled binary. The binary requires a plain UUID and rejects the prefixed value, writing "Error: Invalid session ID. Must be a valid UUID." to stderr and exiting with code 1. No output reaches stdout, so hadFirstResponse is always false and the session never gets a cliSessionId assigned, making every retry hit the same bug.
Environment
- macOS: Darwin 25.4.0 (Apple Silicon)
- Claude Desktop: 1.6608.2 (app.asar modified May 9 00:13)
- Bundled Claude Code binary: 2.1.128 (stored in
~/Library/Application Support/Claude/claude-code/2.1.128/) - CLI Claude Code: 2.1.140 (works fine; not affected)
Reproduction
- Open Claude Desktop → Code mode
- Start any new session (project dir or home dir)
- Send a message
- Session instantly crashes —
Claude Code process exited with code 1,hadFirstResponse=false, cycle time0s
Not reproducible via CLI — the binary works normally when invoked from the terminal.
Root cause
The exact failure
The desktop app stores sessions under ~/Library/Application Support/Claude/claude-code-sessions/<user-id>/<org-id>/<local_session_id>.json. A new session config has no cliSessionId field yet.
When the CCD code spawns the binary for a session without a prior cliSessionId, it passes:
claude --session-id "local_e0ebc081-0224-427c-a476-033eb7e300a4" [other flags...]
The local_ prefix makes this an invalid UUID. The binary exits:
Error: Invalid session ID. Must be a valid UUID. (→ stderr only)
exit code 1
Because nothing is written to stdout, hadFirstResponse stays false. The desktop never receives a session UUID from the binary, so cliSessionId is never stored — and every subsequent retry hits the same code path.
Direct reproduction of the crash
# Reproduces the exact crash (exit 1, no stdout output):
"/path/to/bundled/claude" \
--output-format=stream-json \
--input-format=stream-json \
--session-id "local_e0ebc081-0224-427c-a476-033eb7e300a4"
# → "Error: Invalid session ID. Must be a valid UUID." on stderr
# → exit code 1
# Contrast — valid UUID works:
"/path/to/bundled/claude" \
--output-format=stream-json \
--input-format=stream-json \
--session-id "e0ebc081-0224-427c-a476-033eb7e300a4"
# → proper stream-json init message, exit code 0
Session log evidence
~/Library/Logs/Claude/main.log shows the correlation is 100%:
| Session created | Has cliSessionId? | Crashes? |
|---|---|---|
| May 4–8 (before update) | ✅ Yes | ❌ No |
| May 9–12 (after update) | ❌ No | ✅ Yes |
Every session created on or after May 9 at 00:13 (the app.asar modification timestamp) lacks cliSessionId and crashes with exit code 1. Every session created before that works.
The regression
Pre-update behaviour: CCD strips the local_ prefix before passing to --session-id (session UUID only → valid). Post-update behaviour: CCD passes the full desktop session ID including local_ prefix → binary rejects → exit code 1.
Workaround
Manually inject cliSessionId into each failing session config (the UUID part of sessionId, without the local_ prefix). This puts the desktop on the code path that uses the valid UUID:
python3 << 'PATCH'
import json, os, glob
sessions_dir = os.path.expanduser(
"~/Library/Application Support/Claude/claude-code-sessions"
)
for path in glob.glob(f"{sessions_dir}/**/*.json", recursive=True):
d = json.load(open(path))
if not d.get("cliSessionId") and d.get("sessionId","").startswith("local_"):
d["cliSessionId"] = d["sessionId"].replace("local_", "", 1)
json.dump(d, open(path, "w"), separators=(",", ":"))
print("Patched:", os.path.basename(path))
PATCH
Then restart Claude Desktop. Sessions that previously crashed should now open correctly.
Expected behaviour
The desktop app should pass --session-id "<uuid>" (without the local_ prefix) so the binary can accept it, or omit --session-id entirely for brand-new sessions.
Impact
This affects all Code-mode sessions created since the May 9 app.asar update. Users with no pre-update sessions cannot use Code mode at all from the desktop app. The CLI is completely unaffected.
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗