Skip to content

fix: use system claude binary in packaged Electron app#1189

Open
JustYannicc wants to merge 1 commit intopingdotgg:codething/648ca884-claudefrom
JustYannicc:fix/claude-adapter-system-binary-v2
Open

fix: use system claude binary in packaged Electron app#1189
JustYannicc wants to merge 1 commit intopingdotgg:codething/648ca884-claudefrom
JustYannicc:fix/claude-adapter-system-binary-v2

Conversation

@JustYannicc
Copy link

@JustYannicc JustYannicc commented Mar 18, 2026

What Changed

Default pathToClaudeCodeExecutable to "claude" (resolved via PATH) instead of leaving it unset, which lets the SDK fall back to its bundled cli.js.

Why

The claude-agent-sdk bundles its own cli.js inside node_modules. In the packaged Electron app this file gets packed into the asar archive, where child_process.spawn cannot execute it — the Claude Code process exits with code 1 immediately after session start.

Using the system claude binary matches how the Codex adapter already defaults to "codex".

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Fix Claude binary path to default to system claude in packaged Electron app

In ClaudeAdapter.ts, pathToClaudeCodeExecutable is now always set in queryOptions, defaulting to "claude" when no binaryPath is provided. Previously, the field was omitted entirely when binaryPath was absent, which caused the packaged Electron app to fail to locate the system Claude binary.

Macroscope summarized 12685fb.

@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ccb4e866-f611-4f7a-a1e0-4f5059a1945b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 18, 2026
The claude-agent-sdk bundles its own cli.js inside node_modules. In the
packaged Electron app this file lives inside the asar archive, where
child_process.spawn cannot execute it — causing the Claude Code process
to exit with code 1 immediately after session start.

Default pathToClaudeCodeExecutable to "claude" (resolved via PATH) so
the adapter uses the system-installed binary, matching how the Codex
adapter already defaults to "codex".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JustYannicc JustYannicc force-pushed the fix/claude-adapter-system-binary-v2 branch from 69f1e25 to 12685fb Compare March 18, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant