claude-code - 💡(How to fix) Fix Code tab unresponsive: Electron env vars (OPERON_SANDBOXED_NETWORK) break bundled CLI [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46440Fetched 2026-04-11 06:20:14
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×3commented ×2closed ×1cross-referenced ×1

The Code tab in Claude Desktop silently fails — user sends a message, gets no response. The Chat and Co-Work tabs work fine. The CLI works fine from Terminal.

Error Message

When Claude Desktop (Electron) spawns the bundled CLI binary for the Code tab, it inherits Electron environment variables — specifically OPERON_SANDBOXED_NETWORK=1. This blocks the Bun binary's network access, causing it to crash instantly with error: An unknown error occurred (Unexpected) (exit code 1, zero seconds, no output).

Root Cause

When Claude Desktop (Electron) spawns the bundled CLI binary for the Code tab, it inherits Electron environment variables — specifically OPERON_SANDBOXED_NETWORK=1. This blocks the Bun binary's network access, causing it to crash instantly with error: An unknown error occurred (Unexpected) (exit code 1, zero seconds, no output).

Fix Action

Fix / Workaround

Current Workaround

Code Example

DIR=~/Library/Application\ Support/Claude/claude-code/VERSION/claude.app/Contents/MacOS
mv "$DIR/claude" "$DIR/claude.real"
codesign --force --sign - "$DIR/claude.real"
cat > "$DIR/claude" << 'WRAPPER'
#!/bin/bash
DIR="$(dirname "$0")"
cd "$HOME" 2>/dev/null || cd /tmp
unset OPERON_SANDBOXED_NETWORK
unset ELECTRON_RUN_AS_NODE
unset ELECTRON_NO_ASAR
unset NODE_OPTIONS
exec "$DIR/claude.real" "$@"
WRAPPER
chmod +x "$DIR/claude"
RAW_BUFFERClick to expand / collapse

Summary

The Code tab in Claude Desktop silently fails — user sends a message, gets no response. The Chat and Co-Work tabs work fine. The CLI works fine from Terminal.

Root Cause

When Claude Desktop (Electron) spawns the bundled CLI binary for the Code tab, it inherits Electron environment variables — specifically OPERON_SANDBOXED_NETWORK=1. This blocks the Bun binary's network access, causing it to crash instantly with error: An unknown error occurred (Unexpected) (exit code 1, zero seconds, no output).

Additional Issue After macOS Updates

On recent macOS versions (Darwin 25.4.0 / macOS Tahoe), code signature enforcement is stricter. If users attempt to work around the env var issue by wrapping the binary, macOS will SIGKILL the process (exit code 137) if the binary's filename doesn't match its original code signature.

Environment

  • macOS Tahoe (Darwin 25.4.0)
  • Claude Desktop (latest)
  • Bundled CLI version: 2.1.92
  • Architecture: arm64 (Apple Silicon)

Current Workaround

A shell wrapper that unsets the Electron env vars before exec-ing the original binary, with an ad-hoc re-sign step:

DIR=~/Library/Application\ Support/Claude/claude-code/VERSION/claude.app/Contents/MacOS
mv "$DIR/claude" "$DIR/claude.real"
codesign --force --sign - "$DIR/claude.real"
cat > "$DIR/claude" << 'WRAPPER'
#!/bin/bash
DIR="$(dirname "$0")"
cd "$HOME" 2>/dev/null || cd /tmp
unset OPERON_SANDBOXED_NETWORK
unset ELECTRON_RUN_AS_NODE
unset ELECTRON_NO_ASAR
unset NODE_OPTIONS
exec "$DIR/claude.real" "$@"
WRAPPER
chmod +x "$DIR/claude"

This breaks on every CLI auto-update and every OS update that tightens signature enforcement.

Suggested Fix

Strip OPERON_SANDBOXED_NETWORK (and other Electron-internal env vars) from the child process environment before spawning the Code tab CLI binary. The CLI needs network access to function — inheriting the Electron sandbox restriction is unintentional.

extent analysis

TL;DR

Strip Electron-internal environment variables, such as OPERON_SANDBOXED_NETWORK, from the child process environment before spawning the Code tab CLI binary to restore network access.

Guidance

  • Identify and remove all Electron-internal environment variables that restrict network access or interfere with the CLI's functionality.
  • Verify that the Code tab in Claude Desktop can successfully send messages and receive responses after applying the fix.
  • Consider implementing a mechanism to automatically update the environment variables when the CLI binary is updated or when the OS updates tighten signature enforcement.
  • Test the fix on different macOS versions, including the latest (Darwin 25.4.0 / macOS Tahoe), to ensure compatibility and effectiveness.

Example

No explicit code example is provided, as the issue suggests modifying the Electron environment variables before spawning the CLI binary, which may involve changes to the Claude Desktop application code.

Notes

The suggested fix may require modifications to the Claude Desktop application code, and its implementation may depend on the specific Electron version and macOS environment being used. Additionally, the fix should be tested thoroughly to ensure that it does not introduce any new issues or security vulnerabilities.

Recommendation

Apply the workaround by stripping Electron-internal environment variables, as it directly addresses the root cause of the issue and restores network access to the CLI binary. This approach is preferred over attempting to upgrade to a fixed version, as the issue is specific to the interaction between Claude Desktop and the CLI binary.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING