Skip to content

Recommend native install for Claude Code CLI (avoid sudo-npm footgun) #476

Description

@BaseInfinity

Context

The wizard never documents how to install the Claude Code CLI itself — CLAUDE_CODE_SDLC_WIZARD.md line ~100 references npm i -g @anthropic-ai/claude-code@<new_version> but that's internal maintainer tooling for the version-test benchmark procedure, not end-user guidance. There's no consumer-facing recommendation anywhere in the wizard docs.

Official docs (https://code.claude.com/docs/en/setup) explicitly label native install as "Recommended":

  • Native installs auto-update in the background; no manual claude update needed.
  • npm installs can silently fail to auto-update if the global npm dir isn't writable.
  • Docs explicitly warn: do NOT use sudo npm install -g — it causes exactly the permission/ownership problems that break future updates and uninstalls.

What happened (live repro, 2026-07-27)

On a real machine, @anthropic-ai/claude-code had at some point been installed via sudo npm install, silently leaving /opt/homebrew/lib/node_modules/@anthropic-ai/claude-code root-owned. This caused:

  1. claude update to fail with "Insufficient permissions to install update."
  2. A subsequent npm uninstall -g @anthropic-ai/claude-code to fail with EACCES (can't rename a root-owned directory as a normal user).
  3. Two claude binaries left on PATH simultaneously after switching to claude install (native) — the native one (~/.local/bin/claude) and the stale root-owned npm shim (/opt/homebrew/bin/claude), silently resolved by PATH order with no warning. If PATH order ever changed, the user would silently fall back to the old npm-pinned version.

None of this is a wizard bug — it's a real footgun a wizard-driven session hit while doing routine maintenance, and the wizard is exactly the kind of doc that should steer users away from it up front.

Proposal

Add a short note somewhere sensible (README "Getting Started" and/or CLAUDE_CODE_SDLC_WIZARD.md's prerequisites section) recommending:

  • Install Claude Code via the native installer (curl -fsSL https://claude.ai/install.sh | bash / the Windows equivalents), matching the official docs' own "Recommended" guidance.
  • Explicitly warn against sudo npm install -g @anthropic-ai/claude-code.
  • Optionally, a one-liner for claude doctor as the way to spot conflicting installs (the official docs point there too: "Check for conflicting installations").

Happy to open the PR if there's agreement on placement — mainly wanted to get this filed while it was fresh from a live repro.

Metadata

Metadata

Assignees

No one assigned

    Labels

    impact:consumersOn a package.json files path (npm pack --dry-run) — reaches every install

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions