Core Installation
1. System
Prepare your operating system for AI-powered development. Install essential dependencies on your platform.
Before anything else, prepare your system with the base dependencies that various tools require. Select your platform:
sudo apt update && sudo apt upgrade -ysudo apt install -y build-essential curl wget unzip git jq ripgrep iproute2 net-toolssudo apt update && sudo apt upgrade -ysudo apt install -y build-essential curl wget unzip git jq ripgrep iproute2 net-toolsUbuntu WSL already comes with curl, git, and wget, but often in outdated versions. The apt upgrade fixes that.
xcode-select --installThis command opens a system dialog asking for confirmation. Accept it and wait for the installation to complete (includes Git, C/C++ compilers, and essential tools).
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"After installing Homebrew, follow the instructions shown in the terminal to add brew to your PATH (usually involves adding a line to ~/.zprofile).
brew install jq ripgrep wgetTip: For the most complete Claude Code experience on Windows, consider using WSL2 (WSL2 tab above). Native Windows support works well, but WSL2 offers better sandboxing and compatibility with Unix tools.
Open PowerShell as Administrator:
winget install --id Git.Git -e --source wingetGit for Windows is required. Claude Code on Windows depends on the Git Bash that comes with it. After installing, close and reopen PowerShell.
winget install --id jqlang.jq -e --source winget
winget install --id BurntSushi.ripgrep.MSVC -e --source wingetWindows does not need build-essential — Visual Studio Build Tools will be installed automatically if required by tools like Node.js.
Why does this matter?
build-essential/ Xcode CLT — C/C++ compilers needed to install native packages (Node, Python)curl/wget— all official installers use one of thesegit— Claude Code relies heavily on Git to navigate, commit, and create PRsjq— command-line JSON processor, recommended by the official docs for parsing programmatic mode output (claude -p), and used in hooks and pluginsripgrep— fast file search (rg), used internally by Claude Code to search through source code. It comes bundled with Claude Code, but installing it separately ensures it works in other contexts too
Passwordless Sudo — Autonomy for Claude Code
Claude Code frequently needs sudo to install tools and adjust the system. Without the configuration below, it gets stuck waiting for the password.
echo "$USER ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/$USERThis removes the password barrier for all sudo commands. Suitable for personal development machines, but not recommended for production servers.
Claude Code frequently needs sudo to install tools and adjust the system. Without the configuration below, it gets stuck waiting for the password.
echo "$USER ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/$USERThis removes the password barrier for all sudo commands, not just Claude Code's. Suitable for WSL development environments where Linux runs locally, but not recommended for production servers.
On macOS, Homebrew installs packages without sudo, so most Claude Code commands do not require elevated privileges. If needed, Claude Code will prompt for your password on a case-by-case basis.
If you want to configure passwordless sudo on macOS (optional):
sudo sh -c 'echo "$(whoami) ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/$(whoami)'On Windows, Claude Code runs in the user's PowerShell and does not use sudo. If a command requires administrator privileges, Windows will display the UAC prompt automatically.
No special permission configuration is needed on Windows.