[BUG] Claude CLI prepends its own Node & Yarn paths before Volta shims, overriding versions pinned in package.json

Resolved 💬 6 comments Opened Jul 1, 2025 by HerrR Closed Jan 6, 2026

Environment

  • Platform (select one):
  • [X] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.35 (Claude Code)
  • Operating System: macOS 15.5
  • Terminal: iTerm2
  • Volta version: 1.1.1
  • Default Node version used in Volta: 20.17.0

Bug Description

When using Volta (or any other tool that relies on shims via $PATH) to manage JavaScript environments, Claude Code prepends fixed node and yarn paths to the $PATH, which leads to execution of versions not defined in package.json or .volta configuration.

Steps to Reproduce

  1. Install and configure Volta
  2. Create a new NPM project: mkdir test-project && cd test-project && npm init -y
  3. Pin specific node version: volta pin node@20.18.2
  4. Launch Claude and run /init inside the project
  5. Ask Claude to execute the following commands in sequence: node --version, echo $PATH

Expected Behavior

Bash(node --version)
⎿  v20.18.2

Bash(echo $PATH)
⎿ /some/user/path/.volta/bin:...

Actual Behavior

Bash(node --version)
⎿  v20.17.0

Bash(echo $PATH)
⎿ /some/user/path/.volta/tools/image/yarn/4.9.2/bin:/some/user/path/.volta/tools/image/node/20.17.0/bin:/some/user/path/.volta/bin...

Additional Context

None

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗