From a20f6b8af493c802f2c663631fa0996794fcb3ee Mon Sep 17 00:00:00 2001 From: simosmik Date: Tue, 21 Apr 2026 14:54:33 +0000 Subject: [PATCH] feat: add "claude" as fallback in the cli path --- server/claude-sdk.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/claude-sdk.js b/server/claude-sdk.js index c934f595..7239f81a 100644 --- a/server/claude-sdk.js +++ b/server/claude-sdk.js @@ -153,9 +153,11 @@ function mapCliOptionsToSDK(options = {}) { // Since SDK 0.2.113, options.env replaces process.env instead of overlaying it. sdkOptions.env = { ...process.env }; - if (process.env.CLAUDE_CLI_PATH) { - sdkOptions.pathToClaudeCodeExecutable = process.env.CLAUDE_CLI_PATH; - } + // Use CLAUDE_CLI_PATH if explicitly set, otherwise fall back to 'claude' on PATH. + // The SDK 0.2.113+ looks for a bundled native binary optional dep by default; + // this fallback ensures users who installed via the official installer still work + // even when npm prune --production has removed those optional deps. + sdkOptions.pathToClaudeCodeExecutable = process.env.CLAUDE_CLI_PATH || 'claude'; // Map working directory if (cwd) {