Skip to content

fix: Update outdated Claude Code CLI install instructions#1635

Merged
Crunchyman-ralph merged 4 commits intoeyaltoledano:nextfrom
bjcoombs:1634-fix-claude-code-install-instructions
Feb 23, 2026
Merged

fix: Update outdated Claude Code CLI install instructions#1635
Crunchyman-ralph merged 4 commits intoeyaltoledano:nextfrom
bjcoombs:1634-fix-claude-code-install-instructions

Conversation

@bjcoombs
Copy link
Copy Markdown
Contributor

@bjcoombs bjcoombs commented Feb 20, 2026

Summary

  • Claude Code now distributes as a native binary (installed via curl -fsSL https://claude.ai/install.sh | bash or platform package managers) rather than via npm install -g @anthropic-ai/claude-code
  • Updated warning/error messages and documentation to reference the official install page instead of the deprecated npm install command

Changes Made

  • src/ai-providers/claude-code.js - Updated CLI detection warning and initialization error messages to link to official docs
  • packages/tm-core/src/modules/loop/services/loop.service.ts - Updated loop service ENOENT error message
  • docs/examples/claude-code-usage.md - Updated Requirements section with current install method

Test plan

  • Verify warning message displays correct URL when Claude CLI is not found
  • Verify error message in loop service displays correct URL
  • Verify docs render correctly with updated install instructions

Closes #1634


Note

Low Risk
Small, localized changes to CLI detection and user messaging; primary risk is false-positive/negative detection from the added path probing.

Overview
Fixes Claude Code CLI discovery when the claude binary isn’t on PATH (e.g., minimal MCP server environments) by probing common native install locations and temporarily extending PATH when found.

Updates user-facing docs and runtime error/warning messages to point to Anthropic’s official Claude Code install/getting-started documentation (and switches the example install command to the curl ... | bash installer). Adds a patch changeset for the release.

Written by Cursor Bugbot for commit f6eb5ae. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • Documentation

    • Rewrote setup steps in the Claude Code usage guide, consolidating requirements, replacing an explicit package install with a curl-based installer, and linking to official getting-started docs.
    • Added a changeset documenting the patch and updated install guidance.
  • Bug Fixes

    • Improved Claude Code CLI detection by searching common native install locations and validating discovered binaries.
    • Updated error and warning messages to direct users to the Claude Code getting-started documentation.

Claude Code now distributes as a native binary rather than an npm
package. Update warning/error messages and documentation to reference
the official install page instead of `npm install -g @anthropic-ai/claude-code`.

Closes eyaltoledano#1634
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 20, 2026

🦋 Changeset detected

Latest commit: f6eb5ae

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 20, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Updated Claude Code CLI detection and messaging: added filesystem/location-based binary discovery and validation, replaced npm-based install guidance with curl/install script and docs links in docs and error messages, and adjusted an ENOENT runtime error message accordingly.

Changes

Cohort / File(s) Summary
Documentation
docs/examples/claude-code-usage.md
Rewrote Requirements section: removed explicit npm install -g @anthropic-ai/claude-code`` instruction, added curl-based installer example and link to Claude Code docs; reflowed and renumbered steps.
CLI Detection & Messaging
src/ai-providers/claude-code.js
Added filesystem/location-based discovery for the Claude binary (checks common install paths like ~/.local/bin, ~/.bun/bin, /usr/local/bin), validates candidates via --version, updates PATH when found, and changes warning/error text to point to Claude Code getting-started/docs URL.
Runtime Error Message
packages/tm-core/src/modules/loop/services/loop.service.ts
Replaced ENOENT error message that referenced npm install with one directing users to the Claude Code CLI documentation URL.
Changeset
.changeset/fix-claude-code-install-detection.md
New changeset documenting a patch that fixes Claude Code CLI detection for native binary installations and updates install guidance to reference official documentation.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • Crunchyman-ralph
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: updating outdated Claude Code CLI install instructions across code, docs, and error messages.
Linked Issues check ✅ Passed All code changes align with issue #1634 objectives: updated CLI detection and error messages in claude-code.js and loop.service.ts, plus documentation updates to reference current install methods.
Out of Scope Changes check ✅ Passed All changes are scoped to updating outdated Claude Code install instructions in code and documentation; no unrelated modifications detected.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (5)
docs/examples/claude-code-usage.md (1)

62-65: Consider adding Windows install instructions.

The native binary install method curl -fsSL https://claude.ai/install.sh | bash is for Linux/macOS, while Windows users need irm https://claude.ai/install.ps1 | iex. The current text doesn't note this platform split, which could leave Windows users without clear guidance.

📝 Suggested update
-1. Claude Code CLI must be installed and authenticated on your system. Install from the [official docs](https://docs.anthropic.com/en/docs/claude-code/overview) or run:
+1. Claude Code CLI must be installed and authenticated on your system. Install from the [official docs](https://docs.anthropic.com/en/docs/claude-code/overview) or run the appropriate command for your platform:
+
+   **macOS/Linux:**
    ```bash
    curl -fsSL https://claude.ai/install.sh | bash
    ```
+
+   **Windows (PowerShell):**
+   ```powershell
+   irm https://claude.ai/install.ps1 | iex
+   ```
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/claude-code-usage.md` around lines 62 - 65, The install
instructions currently only show the POSIX installer command "curl -fsSL
https://claude.ai/install.sh | bash"; add a Windows (PowerShell) alternative by
appending a short labeled section (e.g., "**Windows (PowerShell):**") and
include the PowerShell installer command "irm https://claude.ai/install.ps1 |
iex", ensuring the platform split is clear to Windows users and placed next to
the existing bash example.
.changeset/help-sync-test-enhancements.md (1)

5-5: Changeset summary should use imperative mood

Line 5 uses past tense "Enhanced" — per the project's changeset convention, the summary line should be in imperative mood (e.g., "Enhance help documentation sync test to verify subcommand structure…").

✏️ Proposed fix
-Enhanced help documentation sync test to verify subcommand structure and improve test maintainability
+Enhance help documentation sync test to verify subcommand structure and improve test maintainability

Based on learnings: "Provide a concise, single-line changeset summary in imperative mood (e.g., 'Add feature X', 'Fix bug Y') that describes what changed from a user/consumer perspective."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.changeset/help-sync-test-enhancements.md at line 5, Change the changeset
summary from past tense to imperative mood: replace "Enhanced help documentation
sync test to verify subcommand structure and improve test maintainability" with
"Enhance help documentation sync test to verify subcommand structure and improve
test maintainability" in the .changeset help-sync-test-enhancements.md summary
line.
apps/cli/tests/unit/help-documentation-sync.spec.ts (3)

74-77: console.warn leaks diagnostic output into test runner even on success.

When the modern commands directory doesn't exist, this console.warn will print on every test run. Consider using a vitest spy or simply returning an empty array silently. If the warning is important for debugging, gate it behind a check that only warns when the directory is expected to exist.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/cli/tests/unit/help-documentation-sync.spec.ts` around lines 74 - 77,
Replace the direct console.warn in the catch block that reads "Could not read
modern commands directory" to avoid leaking output into the test runner: in the
try/catch inside help-documentation-sync.spec.ts remove the console.warn and
simply return an empty array (or otherwise proceed silently) when the directory
is absent; alternatively, if the warning is useful for debugging keep a
conditional or use a vitest spy on console.warn in the test harness to control
when the message is emitted. This change targets the catch block handling
"error" for the modern commands directory read so that tests no longer print
diagnostics on successful runs.

361-397: Regex [^}]+} for isolating list command entries is fragile.

/name:\s*['"]list['"][^}]+}/g on lines 373 and 406 matches from name: 'list' to the first }. If the list command object contains nested objects (e.g., options: { ... }), the match will terminate prematurely at the inner closing brace, potentially missing documented options. A balanced-brace or section-isolation approach would be more robust.

Also applies to: 399-427


119-140: Consider adding a comment or assertion to catch stale entries in INTENTIONALLY_UNDOCUMENTED.

As commands are removed from the codebase over time, entries here can become stale without anyone noticing. A lightweight check (e.g., verifying each undocumented command still exists in cliCommands) would keep this list honest and prevent it from becoming a catch-all that silently masks missing documentation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/cli/tests/unit/help-documentation-sync.spec.ts` around lines 119 - 140,
Add a lightweight assertion in the test that verifies every symbol in
INTENTIONALLY_UNDOCUMENTED still corresponds to an existing command in the
runtime command registry (e.g., the cliCommands collection used by the test);
iterate INTENTIONALLY_UNDOCUMENTED and for each entry assert that cliCommands
has/finds a command with that name, failing the test with a clear message if any
entry is stale or missing. Ensure the assertion uses the same identifiers
(INTENTIONALLY_UNDOCUMENTED and cliCommands) so future diffs will catch removed
commands and prompt updating the list.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/tm-core/src/modules/loop/services/loop.service.ts`:
- Around line 586-590: The error-handling branch checking error.code ===
'ENOENT' returns a user-facing message; update the non-sandbox message to rename
the CLI to "Claude Code CLI" and point the URL to Anthropic's
getting-started/install page (use the getting-started install-specific link
instead of the overview). Modify the string returned in the error.code ===
'ENOENT' branch (the ternary that depends on the sandbox variable) so the
non-sandbox arm reads something like "Claude Code CLI is not installed. Install
it from: <Anthropic getting-started/install URL>" to match
src/ai-providers/claude-code.js and documentation naming.

---

Duplicate comments:
In `@src/ai-providers/claude-code.js`:
- Around line 86-93: The warning string in claude-code.js uses the less-helpful
overview URL; update the URL in the log call (the log('warn', ...) inside the
block that sets _claudeCliChecked = true) to point to a more direct
install/setup page (e.g. replace
https://docs.anthropic.com/en/docs/claude-code/overview with a getting-started
or setup path such as .../claude-code/getting-started or .../claude-code/setup)
so users land on installation steps; modify the message passed to log
accordingly and leave the surrounding try/finally and _claudeCliChecked logic
unchanged.

---

Nitpick comments:
In @.changeset/help-sync-test-enhancements.md:
- Line 5: Change the changeset summary from past tense to imperative mood:
replace "Enhanced help documentation sync test to verify subcommand structure
and improve test maintainability" with "Enhance help documentation sync test to
verify subcommand structure and improve test maintainability" in the .changeset
help-sync-test-enhancements.md summary line.

In `@apps/cli/tests/unit/help-documentation-sync.spec.ts`:
- Around line 74-77: Replace the direct console.warn in the catch block that
reads "Could not read modern commands directory" to avoid leaking output into
the test runner: in the try/catch inside help-documentation-sync.spec.ts remove
the console.warn and simply return an empty array (or otherwise proceed
silently) when the directory is absent; alternatively, if the warning is useful
for debugging keep a conditional or use a vitest spy on console.warn in the test
harness to control when the message is emitted. This change targets the catch
block handling "error" for the modern commands directory read so that tests no
longer print diagnostics on successful runs.
- Around line 119-140: Add a lightweight assertion in the test that verifies
every symbol in INTENTIONALLY_UNDOCUMENTED still corresponds to an existing
command in the runtime command registry (e.g., the cliCommands collection used
by the test); iterate INTENTIONALLY_UNDOCUMENTED and for each entry assert that
cliCommands has/finds a command with that name, failing the test with a clear
message if any entry is stale or missing. Ensure the assertion uses the same
identifiers (INTENTIONALLY_UNDOCUMENTED and cliCommands) so future diffs will
catch removed commands and prompt updating the list.

In `@docs/examples/claude-code-usage.md`:
- Around line 62-65: The install instructions currently only show the POSIX
installer command "curl -fsSL https://claude.ai/install.sh | bash"; add a
Windows (PowerShell) alternative by appending a short labeled section (e.g.,
"**Windows (PowerShell):**") and include the PowerShell installer command "irm
https://claude.ai/install.ps1 | iex", ensuring the platform split is clear to
Windows users and placed next to the existing bash example.

Comment thread packages/tm-core/src/modules/loop/services/loop.service.ts
@bjcoombs bjcoombs changed the base branch from main to next February 20, 2026 09:04
Address CodeRabbit review feedback:
- Use /getting-started URL instead of /overview for install links
- Rename "Claude CLI" to "Claude Code CLI" for consistency

Fix false warning when running as MCP server with minimal PATH:
- Fall back to checking common install locations (~/.local/bin,
  ~/.bun/bin, /usr/local/bin) when PATH-based lookup fails
Comment thread src/ai-providers/claude-code.js
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/ai-providers/claude-code.js`:
- Line 14: Replace use of execSync with execFileSync: update the import to use
execFileSync and change calls that currently interpolate the executable/path
into a template literal (the call that uses the variable found) to
execFileSync(executablePath, [found, ...args], { encoding: 'utf8' }) so the path
is passed as an argument instead of through a shell; ensure you pass the
executable (e.g., the Claude binary) as the first parameter and the found path
as an element in the args array, preserve existing error handling and options,
and apply the same conversion to any other execSync invocations that build shell
strings using found.

Comment thread src/ai-providers/claude-code.js Outdated
- Use execFileSync instead of execSync with template literal to avoid
  shell injection risk (CodeRabbit)
- Add found binary's directory to process.env.PATH so the SDK can
  resolve it via PATH lookup downstream (Cursor Bugbot)
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
src/ai-providers/claude-code.js (2)

92-96: commonPaths is Unix-only despite a Windows PATH-separator guard on line 106.

The process.platform === 'win32' check at line 106 signals intent to support Windows, but commonPaths contains only Unix paths. On Windows, existsSync will return false for all three entries, so the fallback discovery always fails silently. Consider either adding common Windows install locations or restricting the entire block to non-Windows platforms.

♻️ Proposed fix
 const commonPaths = [
     join(home, '.local', 'bin', 'claude'),
     join(home, '.bun', 'bin', 'claude'),
     '/usr/local/bin/claude'
 ];
+// Windows equivalents (Claude installer typically places the binary here)
+if (process.platform === 'win32') {
+    commonPaths.push(
+        join(process.env.LOCALAPPDATA || '', 'Programs', 'Claude', 'claude.exe'),
+        join(process.env.APPDATA || '', 'Claude', 'claude.exe')
+    );
+}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/ai-providers/claude-code.js` around lines 92 - 96, The array commonPaths
currently lists only Unix-style locations, so on Windows the subsequent
process.platform === 'win32' guard is contradicted and existsSync will never
find the binary; update the discovery in claude-code.js by either (a) adding
common Windows install paths to commonPaths (e.g., include
%LOCALAPPDATA%/Programs, %USERPROFILE%/AppData/Local/bin or typical installer
locations) and expand join(home, ...) usage for Windows, or (b) wrap the
Unix-style commonPaths block in a non-Windows conditional and add a separate
Windows-only path array used when process.platform === 'win32'; adjust the
existsSync checks (and any join usage) to use the appropriate array based on
process.platform so discovery works on Windows and Unix.

118-118: Duplicate docs URL — extract to a module-level constant.

The same URL literal appears on both line 118 and line 181. A single constant eliminates the risk of a future update touching one site but not the other.

♻️ Proposed refactor
+const CLAUDE_CODE_DOCS_URL =
+    'https://docs.anthropic.com/en/docs/claude-code/getting-started';
+
 let _claudeCliChecked = false;
 let _claudeCliAvailable = null;
-                    'Claude Code CLI not detected. Install it from: https://docs.anthropic.com/en/docs/claude-code/getting-started'
+                    `Claude Code CLI not detected. Install it from: ${CLAUDE_CODE_DOCS_URL}`
-                `Claude Code CLI not available. Install it from: https://docs.anthropic.com/en/docs/claude-code/getting-started - Original error: ${error.message}`
+                `Claude Code CLI not available. Install it from: ${CLAUDE_CODE_DOCS_URL} - Original error: ${error.message}`

Also applies to: 181-181

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/ai-providers/claude-code.js` at line 118, There are two identical URL
string literals for the Claude Code docs in src/ai-providers/claude-code.js;
extract the URL into a single module-level constant (e.g., const
CLAUDE_CODE_DOCS_URL =
'https://docs.anthropic.com/en/docs/claude-code/getting-started') declared at
the top of the file and replace the literal occurrences inside the messages (the
one in the 'Claude Code CLI not detected...' message and the second occurrence
near line 181) with that constant so both locations reference the same value.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/ai-providers/claude-code.js`:
- Around line 92-96: The array commonPaths currently lists only Unix-style
locations, so on Windows the subsequent process.platform === 'win32' guard is
contradicted and existsSync will never find the binary; update the discovery in
claude-code.js by either (a) adding common Windows install paths to commonPaths
(e.g., include %LOCALAPPDATA%/Programs, %USERPROFILE%/AppData/Local/bin or
typical installer locations) and expand join(home, ...) usage for Windows, or
(b) wrap the Unix-style commonPaths block in a non-Windows conditional and add a
separate Windows-only path array used when process.platform === 'win32'; adjust
the existsSync checks (and any join usage) to use the appropriate array based on
process.platform so discovery works on Windows and Unix.
- Line 118: There are two identical URL string literals for the Claude Code docs
in src/ai-providers/claude-code.js; extract the URL into a single module-level
constant (e.g., const CLAUDE_CODE_DOCS_URL =
'https://docs.anthropic.com/en/docs/claude-code/getting-started') declared at
the top of the file and replace the literal occurrences inside the messages (the
one in the 'Claude Code CLI not detected...' message and the second occurrence
near line 181) with that constant so both locations reference the same value.

@bjcoombs
Copy link
Copy Markdown
Contributor Author

#1629 looks related

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

join(home, '.local', 'bin', 'claude'),
join(home, '.bun', 'bin', 'claude'),
'/usr/local/bin/claude'
];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing Homebrew Apple Silicon path in fallback detection

Medium Severity

The commonPaths array for fallback CLI detection is missing /opt/homebrew/bin/claude, which is the standard Homebrew install location on Apple Silicon Macs. This is a very common platform among developers. The codebase itself already accounts for this path elsewhere (e.g., mcpClient.ts checks /opt/homebrew/bin/npx for "Homebrew on Apple Silicon"). In minimal PATH environments like MCP servers — the exact scenario this fallback targets — the CLI won't be detected for these users.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Collaborator

@Crunchyman-ralph Crunchyman-ralph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Crunchyman-ralph Crunchyman-ralph merged commit e799e62 into eyaltoledano:next Feb 23, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Outdated Claude Code CLI install instructions in warning/error messages

2 participants