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) {