Skip to content

npm-installed Claude at ~/.local/bin is classified as native #27947

Closed

Description

@derek-eliza

What happened

An npm-installed Claude Code under ~/.local is classified as native. T3 selects claude update rather than npm maintenance when Claude is discovered through npm's own command symlink.

Diagnosis

Current main at 80a2351fcb909034e65a512dfabeb3cdfd367762 still contains the same detection order:

  • apps/server/src/provider/Drivers/ClaudeDriver.ts:75: isClaudeNativeCommandPath accepts any path ending in /.local/bin/claude or /.local/bin/claude.exe.
  • packages/provider-core/src/server/maintenanceResolver.ts:466: a matching command path returns native maintenance before resolveNpmGlobalPrefix runs. There is a mise exception, but none for this npm-owned link.

Verified npm ownership should take precedence over a native-looking launcher path. This classification also risks directing an npm installation to the separate native update channel; no downgrade through the npm link was attempted.

Steps to reproduce

  1. Set npm's global prefix to $HOME/.local and run npm install -g @anthropic-ai/claude-code.
  2. Confirm npm created ~/.local/bin/claude -> ../lib/node_modules/@anthropic-ai/claude-code/bin/claude.exe and package metadata exists there.
  3. Let T3 discover Claude through PATH without a custom binaryPath, then refresh the provider.
  4. Observe the native maintenance command.
  5. Point binaryPath directly at the executable inside the same npm package and refresh: maintenance changes to npm.

Version

Affected runtime version retained privately in triage context. Matching source logic verified on main at the commit above; source references do not imply an exact match to the running build.

Environment

npm global prefix ~/.local, with npm's standard command symlink. Personal system details omitted.

Evidence

Observed on the same installation; paths normalized:

PATH discovery:
  updateCommand: <home>/.local/bin/claude update
  canInstallVersion: false

Explicit executable inside the npm package:
  updateCommand: npm install -g --prefix <home>/.local --allow-scripts=@anthropic-ai/claude-code @anthropic-ai/claude-code@latest
  canInstallVersion: true

Both snapshots reported ready/current. T3's actual Update action returned succeeded / Already up to date. The demonstrated failure is maintenance selection, not a failed upgrade in these snapshots.

Related issues

#27942 covers native release-feed lag, rather than an npm install classified as native. #27339 covers mise wrappers, for which an exception already exists. Searches found no matching npm-link report.

Fix applied or workaround

Keep the standard npm installation and set config.binaryPath directly to the executable inside its npm package. T3 then selects npm maintenance. No T3 source changes were made.

Filed by

Codex (gpt-6.1-sol), following T3 triage using server.prepareTriage in the existing session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions