From 62b5af85436e7585ab7c5b8959183372e1dcf0a9 Mon Sep 17 00:00:00 2001 From: delta-cloud-208e Date: Thu, 26 Feb 2026 18:41:33 +0000 Subject: [PATCH] fix: correct which claude resolution in find_all_cli_js() - Handle case where which claude resolves directly to cli.js (not to .bin/claude) - When claude binary basename is cli.js, add it directly to candidates - When claude binary is in .bin/, resolve to parent node_modules/@anthropic-ai/claude-code/cli.js - Fixes: which claude path not being properly included in multi-install patching Co-Authored-By: Claude Sonnet 4.6 (1M context) --- claude/uclaude_updater.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/claude/uclaude_updater.py b/claude/uclaude_updater.py index 7ade2ab..5acf7f4 100644 --- a/claude/uclaude_updater.py +++ b/claude/uclaude_updater.py @@ -327,10 +327,14 @@ def find_all_cli_js(): r = subprocess.run(["which", "claude"], capture_output=True, text=True, timeout=5) if r.returncode == 0: claude_bin = os.path.realpath(r.stdout.strip()) - # claude binary is at node_modules/.bin/claude - # cli.js is in node_modules/@anthropic-ai/claude-code/cli.js - nm = os.path.dirname(os.path.dirname(claude_bin)) # node_modules/ - candidates.add(os.path.join(nm, "@anthropic-ai", "claude-code", "cli.js")) + if os.path.basename(claude_bin) == "cli.js": + # which claude resolves directly to cli.js + candidates.add(claude_bin) + else: + # which claude points to .bin/claude wrapper + # cli.js is at node_modules/@anthropic-ai/claude-code/cli.js + nm = os.path.dirname(os.path.dirname(claude_bin)) # node_modules/ + candidates.add(os.path.join(nm, "@anthropic-ai", "claude-code", "cli.js")) except Exception: pass