This guide explains how to install and use @anthropic-ai/claude-code.
The package requires Node.js ≥ 18.0.0 (as of Aug 20, 2025).
If your current version is older, update it using the steps below.
# Check versions
node -v
npm -v
# Remove old Node.js and npm (if installed via apt)
sudo apt remove -y nodejs npm
# Install NodeSource Node.js 18 (or newer)
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs
# Verify installation
node -v
npm -vYou can install the package in two ways.
sudo npm install -g @anthropic-ai/claude-codeRun directly with npx:
npx @anthropic-ai/claude-codeOr install locally in your project:
npm install @anthropic-ai/claude-code --save-devThen run:
npx claude-codeTo use Claude Code in VS Code, install the extension:
- Extension Name: Claude Code for VSCode
- Marketplace Link: https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code