AI
Claude Code
What is Claude Code?
Claude Code is Anthropic's coding agent for the terminal. It reads your code, edits files, and runs commands in your project directory.
System Requirements
- macOS 13.0+
- Windows 10 1809+ or Windows Server 2019+
- Linux: Ubuntu 20.04+, Debian 10+, or Alpine Linux 3.19+
- 4 GB+ RAM, x64 or ARM64 processor
- A Claude Pro, Max, Ultra, Team, Enterprise, or Console account. The free claude.ai plan does not include Claude Code.
Installation
The native installer is recommended. It installs a standalone binary and keeps it updated automatically in the background.
macOS
curl -fsSL https://claude.ai/install.sh | bash
Or install it with Homebrew:
brew install --cask claude-code
claude-code follows the stable channel (about a week behind). Use claude-code@latest to get new versions as soon as they ship. Homebrew installs do not auto-update, so run brew upgrade claude-code from time to time.
Linux
curl -fsSL https://claude.ai/install.sh | bash
On Alpine Linux, install bash and curl first:
apk add bash curl
Debian / Ubuntu (apt)
sudo apt install curl gnupg
sudo install -d -m 0755 /etc/apt/keyrings
sudo curl -fsSL https://downloads.claude.ai/keys/claude-code.asc \
-o /etc/apt/keyrings/claude-code.asc
echo "deb [signed-by=/etc/apt/keyrings/claude-code.asc] https://downloads.claude.ai/claude-code/apt/stable stable main" \
| sudo tee /etc/apt/sources.list.d/claude-code.list
sudo apt update
sudo apt install claude-code
Fedora / RHEL (dnf)
sudo tee /etc/yum.repos.d/claude-code.repo <<'EOF'
[claude-code]
name=Claude Code
baseurl=https://downloads.claude.ai/claude-code/rpm/stable
enabled=1
gpgcheck=1
gpgkey=https://downloads.claude.ai/keys/claude-code.asc
EOF
sudo dnf install claude-code
Package manager installs update through your normal system upgrades.
Windows
Run this in PowerShell (no Administrator needed):
irm https://claude.ai/install.ps1 | iex
Or in CMD:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Or with WinGet:
winget install Anthropic.ClaudeCode
Installing Git for Windows is recommended. With it, Claude Code uses Git Bash to run shell commands; without it, Claude Code falls back to PowerShell.
You can also use WSL: open your WSL distribution and run the Linux installer. WSL 2 supports sandboxing, which native Windows does not.
Any OS (npm)
The npm package needs Node.js 22+:
npm install -g @anthropic-ai/claude-code@latest
Don't use sudo
Do not run sudo npm install -g. It causes permission problems and stops Claude Code from updating itself.
Install a Specific Version
Pass a version number (or stable / latest) to the installer:
# macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash -s 2.1.268
# Windows PowerShell
& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) 2.1.268
Or with npm:
npm install -g @anthropic-ai/claude-code@2.1.268
This pins your installation to version 2.1.268, which keeps the same experience across your team or environment.
Verify the Installation
claude --version
For a full health check of the install and your settings files:
claude doctor
Sign In
Open a project directory and start Claude Code:
cd your-project
claude
Follow the browser prompt to log in. If ANTHROPIC_API_KEY is set and you approve it, Claude Code uses the API key instead.
Configuration (settings.json)
Claude Code reads its settings from JSON files:
| Scope | Location | Notes |
|---|---|---|
| User | ~/.claude/settings.json | Applies to every project on your machine |
| Shared project | .claude/settings.json | Commit it to share with your team |
| Project local | .claude/settings.local.json | Only you, only this project; kept out of git |
When the same key is set in more than one file, the most specific one wins: project local > shared project > user. Lists such as permissions.allow are merged across files.
On Windows, ~ is your user folder, e.g. C:\Users\<you>\.claude\settings.json.
Settings files are strict JSON: no // comments and no trailing commas. Run /status inside Claude Code to confirm which files loaded.
Permission Modes
The permissions.defaultMode key sets how much Claude Code can do without asking:
| Mode | What runs without asking |
|---|---|
default | Only file reads. Claude asks before edits and commands. |
acceptEdits | File edits and common file commands (mkdir, mv, cp, ...) |
plan | Reads only. Claude writes a plan instead of changing code. |
auto | Everything, with a background safety check that blocks risky actions |
dontAsk | Only pre-approved tools. Anything else is denied, not prompted. |
bypassPermissions | Everything, with no prompts and no safety checks |
Press Shift+Tab in a session to cycle between modes.
Recommended: Auto Mode
Auto mode lets Claude work through long tasks without stopping to ask, while a safety check blocks risky actions such as touching unknown infrastructure. In recent versions it is already the starting mode, but you can set it explicitly:
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"permissions": {
"defaultMode": "auto"
}
}
Allow Specific Commands
To keep prompts for most things but pre-approve the commands you run all the time, add allow rules. Use deny rules to block things completely:
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"permissions": {
"defaultMode": "acceptEdits",
"allow": [
"Bash(npm run *)",
"Bash(git status)",
"Bash(git diff *)",
"WebFetch(domain:github.com)"
],
"deny": ["Read(./.env)", "Read(./.env.*)", "Bash(git push --force *)"],
"additionalDirectories": ["../shared-libs"]
}
}
allow: runs without asking.ask: always asks, even in permissive modes.deny: always blocked, in every mode, includingbypassPermissions.additionalDirectories: extra folders Claude can work in besides the project.
When you choose "Yes, and don't ask again" on a prompt, Claude Code saves an allow rule to .claude/settings.local.json for you.
Full Access (Bypass Permissions)
This turns off every prompt and safety check, so Claude can run any command without asking:
{
"permissions": {
"defaultMode": "bypassPermissions"
}
}
This only works in your user settings (~/.claude/settings.json). For safety, auto and bypassPermissions are ignored in project and local settings files, so a cloned repository can't switch them on for you.
Use with care
With bypassPermissions, Claude can delete files, change system settings, and use your credentials without asking, and nothing protects you from prompt injection. Only use it in a container, a VM, or a disposable machine, and commit your work to Git first so you can roll back. Claude Code refuses to start in this mode as root or under sudo.
Model Settings
You can also set the default model in the same file:
{
"model": "claude-opus-5-5"
}
Use /model and /effort inside a session to switch model or reasoning effort.
Command-Line Flags
You can change the permission mode for a single run without editing settings.json:
# Auto mode with background safety checks
claude --permission-mode auto
# Auto-accept file edits
claude --permission-mode acceptEdits
# No prompts and no safety checks
claude --permission-mode bypassPermissions
# or the equivalent
claude --dangerously-skip-permissions
To try a setting for one session only:
claude --settings '{"model": "claude-opus-5-5"}'
Install the Official Design Plugin
Anthropic maintains an official Frontend Design plugin that helps Claude Code produce distinctive, production-grade UI instead of generic-looking interfaces. It is published in the official claude-plugins-official marketplace.
Install the Plugin
Inside a Claude Code session, run:
/plugin install frontend-design@claude-plugins-official
Or install it from your shell without opening a session:
claude plugin install frontend-design@claude-plugins-official
Add the Marketplace (If Needed)
The official marketplace is registered automatically the first time you launch Claude Code interactively. If the install command reports that the marketplace is not found, add it manually and retry:
/plugin marketplace add anthropics/claude-plugins-official
Verify the Plugin
Run /plugin to open the plugin manager and confirm that frontend-design appears under your installed plugins. You can also browse other official plugins from the Discover tab.
Notes
- Restart Claude Code if the plugin does not take effect immediately.
- Once installed, Claude Code applies the design guidance automatically when you ask it to build web pages, components, or other frontend UI.
Update
Native installs update automatically. To update right away:
claude update
For other install methods:
# Homebrew
brew upgrade claude-code
# WinGet
winget upgrade Anthropic.ClaudeCode
# npm
npm install -g @anthropic-ai/claude-code@latest
Uninstall
# Native install (macOS, Linux, WSL)
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
# Homebrew
brew uninstall --cask claude-code
# npm
npm uninstall -g @anthropic-ai/claude-code
# Native install (Windows PowerShell)
Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force
# WinGet
winget uninstall Anthropic.ClaudeCode