Installation and Configuration
Independent educational resource, not an official Anthropic course. Facts about the API, prices and limits were checked against Anthropic's documentation on 15 November 2026 and the code was run against a local mock of the API, not the live service. Check the linked official pages before relying on a number, and test with your own key.
Installing Claude Code takes a minute. Configuring it properly, so that updates, permissions and settings behave the way you expect, takes a little longer and saves a lot of confusion later. This lesson covers the install, signing in, keeping it up to date, and the one concept that explains most "why didn't my setting apply?" questions: settings files and their precedence.
What you'll learn
- The system requirements and the recommended way to install.
- How to sign in, and which account types work.
- How updates and release channels work.
- Where settings live, which one wins, and how to change them.
- How to check your installation with
claude doctor.
Before you start
Requirements
From Anthropic's setup page: macOS 13 or later, Windows 10 (version 1809) or later or Windows Server 2019, Ubuntu 20.04 or later, Debian 10 or later, or Alpine Linux 3.19 or later; at least 4 GB of RAM; an x64 or ARM64 processor; and an internet connection. It works with Bash, Zsh, PowerShell or CMD, and it's available only in Anthropic's supported countries. Git is optional but you'll want it.
You also need an account. Claude Code requires a Pro, Max, Ultra, Team or Enterprise plan, or a Console account. The free claude.ai plan does not include Claude Code access. Organisations can instead use Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry.
Install
The recommended method is the native installer. It downloads Claude Code and keeps it updated in the background:
# macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash
# Windows PowerShell
irm https://claude.ai/install.ps1 | iex
There are alternatives. Homebrew (brew install --cask claude-code) and WinGet (winget install Anthropic.ClaudeCode) work, but they don't auto-update, so you run brew upgrade claude-code or winget upgrade Anthropic.ClaudeCode yourself. Debian, Fedora, RHEL and Alpine have signed apt, dnf and apk repositories. An npm install (npm install -g @anthropic-ai/claude-code@latest) needs Node.js 22 or later, installs the same native binary, and must never be run with sudo.
The installer shows no progress while it downloads, which surprises people. When it finishes, open a new terminal and check:
claude --version
A working install prints a version number followed by "(Claude Code)". If your shell says claude isn't found, the install folder isn't on your PATH yet, and Anthropic's troubleshooting page covers the fix. Two Windows notes: native Windows doesn't support sandboxing (WSL 2 does), and installing Git for Windows is recommended so Claude Code can use the Bash tool; without it, it uses PowerShell.
On Alpine and other musl distributions, install bash and curl first (apk add bash curl).
Sign in
Start Claude Code in a project and it prompts you to log in on first use:
cd /path/to/your/project
claude
Follow the browser prompts for a subscription or Console account. If you have the ANTHROPIC_API_KEY environment variable set and you approve the key when Claude Code asks, it skips the login prompt and uses the key, which means API billing. A first login with a Console account automatically creates a "Claude Code" workspace there for centralised cost tracking. Type /login inside a session to switch accounts later.
Check your setup with claude doctor
This prints read-only diagnostics without starting a session: install method, version, search tooling, auto-update state, and any problems in your settings files. We ran it on version 2.1.319 in a project with deliberately broken settings, and it reported things like:
Invalid settings
- .claude/settings.json › hooks.PreTool: Unknown hook event "PreTool" was ignored. Valid events: PreToolUse, PostToolUse, ...
- .claude/settings.json › hooks.Stop.0.hooks.0.type: Unknown hook type "shell"; entry ignored. Valid types: command, prompt, agent, http, mcp_tool
and, for a settings file with a trailing comma, Invalid or malformed JSON. Inside a session, /doctor runs a fuller checkup that can fix problems for you. Make claude doctor your first move whenever something behaves oddly.
Updates and release channels
Native installs check for updates on startup and periodically, install in the background, and apply on the next start. You can update immediately with claude update. Two channels exist: latest (the default, new features as soon as they ship) and stable (typically about a week behind, skipping releases with major regressions). Switch in /config or in a settings file:
{
"autoUpdatesChannel": "stable"
}
Switching to stable can move you to an older version, so Anthropic suggests also setting minimumVersion to your current version if you want to avoid a downgrade. A newly released model can require a version newer than the stable channel offers. If you need to stop updates, set DISABLE_AUTOUPDATER to "1" in the env block of your settings; claude update still works then. Teams that distribute Claude Code themselves can use DISABLE_UPDATES to block all paths.
Settings files and precedence
Installing doesn't create any settings file. Claude Code reads settings from four places, and where you put a setting decides who it affects:
| Scope | File | Who it affects |
| User | ~/.claude/settings.json | You, in every project |
| Shared project | .claude/settings.json | Everyone working in the repository, if you commit it |
| Project local | .claude/settings.local.json | You, in this project only. Claude Code keeps it out of git |
| Managed | managed-settings.json and other managed sources | Everyone in an organisation |
When the same key appears in more than one place, the highest level wins, in this order: managed, command line (--settings), project local, shared project, user. List-type keys such as permissions.allow are merged across files instead of replaced. Environment variables aren't a level of their own; whether a variable or a settings key wins is decided per setting.
Three practical points:
- Settings files are strict JSON. A
// comment or a trailing comma makes the file invalid, and Claude Code reports a Settings Error at the next start.
- Add
"$schema": "https://json.schemastore.org/claude-code-settings.json" for autocomplete and validation in your editor. The published schema can lag behind the newest releases, so a warning on a recently documented key isn't proof it's wrong.
- Claude Code watches the files and applies most edits to the running session without a restart.
To change something without editing a file, use /config (a short menu of personal options), or pass a setting for one session:
claude --settings '{"model": "claude-opus-5-5"}'
Inside a session, /status shows which settings files were loaded. To keep Claude Code's data somewhere else, set CLAUDE_CONFIG_DIR.
Uninstall
For a native install, remove ~/.local/bin/claude and ~/.local/share/claude. For Homebrew, WinGet or npm use the matching uninstall command. Your settings and session history live in ~/.claude and ~/.claude.json; deleting them removes your settings, allowed tools, MCP configuration and history, so do that only if you mean to.
Real-world use case (illustrative scenario)
This scenario is an invented example to show how the ideas fit together. It is not a case study and its details are not measured results.
A small agency standardises on Claude Code. Each developer installs it with the native installer. The agency commits one .claude/settings.json per client project with the team's permission rules and hooks, while each developer keeps personal preferences in ~/.claude/settings.json and per-project exceptions in .claude/settings.local.json. When a teammate's hook doesn't run, the first thing everyone does is run claude doctor and /status, which show immediately whether the file loaded and whether a key was rejected.
Mistakes to avoid
- Using
sudo with npm installs.
- Expecting Homebrew or WinGet installs to update themselves.
- Putting a comment in
settings.json.
- Putting personal preferences in the committed file, or team rules in your user file.
- Forgetting that
ANTHROPIC_API_KEY in your environment can switch you to API billing.
- Assuming a higher-scope setting is wrong when a managed policy is overriding it. Check
/status.
Security notes
- The installer is a script you pipe into your shell. If you'd rather verify first, Anthropic publishes signed release manifests and checksums, and the apt, dnf and apk repositories are signed with a published key whose fingerprint you should compare before trusting.
- Never commit API keys in settings files. A project settings file is shared with everyone.
- Managed settings exist so an organisation can enforce policy that individual files can't override.
Cost and speed
Installation itself is free. What you pay for is the account behind it. If you have ANTHROPIC_API_KEY set and approve it, usage bills to your API account per token; with a subscription it draws on your plan's usage limits. The /usage command shows where your usage goes.
Key takeaways
- Use the native installer, verify with
claude --version, and run claude doctor when anything seems wrong.
- You need a paid Claude plan, a Console account or a supported cloud provider; the free claude.ai plan doesn't include Claude Code.
- Native installs auto-update; Homebrew, WinGet and Linux packages don't. Choose
latest or stable.
- Settings come from user, shared project, project local and managed files; higher precedence wins, lists merge, and the files are strict JSON.
Lesson recap: set it up, verify it, and know which settings file wins.
Quick quiz
- Which install method does Anthropic recommend, and does it auto-update?
- Does the free claude.ai plan include Claude Code?
- Which command prints read-only diagnostics about your installation and settings?
- Name the settings scopes from highest precedence to lowest.
- Why can a
// comment break your settings file?
Answers and explanations
- The native installer, which updates in the background. Homebrew and WinGet installs don't.
- No. You need Pro, Max, Ultra, Team or Enterprise, a Console account, or a supported cloud provider.
claude doctor. Inside a session, /doctor gives a fuller checkup.
- Managed, command line, project local, shared project, user.
- Settings files are strict JSON. Comments and trailing commas are syntax errors.
Official references and further reading
Related tutorials