Claude Code setup
You want to try Claude Code. The install is three steps and takes about two minutes if Node.js is already on your machine, five if it isn't. This lesson walks through them so you can get to a working claude prompt in your terminal before the next lesson dives into how to use it well.
What Claude Code gives you
Before the install, a quick tour of what you're actually installing:
- File operations — Claude can search, read, and edit files in the project directory you're running from.
- Terminal access — Claude can run shell commands directly. Tests, builds, git operations, everything.
- Web access — Claude can search documentation, fetch code examples, and pull down content from URLs.
- MCP server support — the MCP client you learned about in the last module is built in. Register any MCP server with Claude Code and its tools become available in your conversations.
The MCP support is the part that turns Claude Code from "useful coding assistant" into "customisable peer engineer tailored to your stack." You can extend it with servers for your own internal APIs, your issue tracker, your design system, your monitoring stack — anything that already has an MCP server or that you're willing to write one for.
Claude Code runs on macOS, Windows (via WSL), and Linux, so whatever your development machine looks like, it's supported.
Step 1 — Install Node.js
Claude Code is distributed as an npm package, so Node.js is the prerequisite. Check whether you already have it:
npm help
If you see npm's help output, skip to step 2. If you see "command not found" or similar, grab Node.js from nodejs.org/en/download and install the LTS version.
On macOS, you can also use Homebrew:
brew install node
On Linux, use your distro's package manager or nvm. On Windows, install Node inside WSL rather than on native Windows.
Confirm the install:
node --version
npm --version
Both should print version numbers.
Step 2 — Install Claude Code
With Node ready, install the CLI globally:
npm install -g @anthropic-ai/claude-code
The -g flag makes claude available as a command from any directory. The package is small and the install finishes in a few seconds.
If you get a permissions error (common on Linux and macOS when /usr/local is root-owned), either prefix with sudo or — much better — configure npm to install global packages into a user-owned prefix first. Check Node's docs for the "Resolving EACCES permissions errors" guide if you hit this.
Step 3 — Start it and log in
From any directory, run:
claude
The first time you run this, Claude Code launches an authentication flow that walks you through signing in to your Anthropic account. Follow the prompts — it'll open a browser or give you a URL to visit, you sign in, and control returns to the terminal with Claude Code ready to use.
After the first login, subsequent runs just start Claude Code directly without re-authenticating. The auth state is stored in your user profile.
Verify it works
With claude running, type a simple test:
> What is 1 + 1?
You should get a near-instant response from Claude — probably just "2" or similar. At this point you know:
- Node is installed correctly.
- The CLI is installed globally.
- Authentication is working.
- The API is reachable.
Nothing project-specific yet. No files have been scanned. No MCP servers are registered. Claude Code at this stage is a terminal chatbot — useful but not exciting. The next lesson covers the workflows that turn it from "terminal chatbot" into "peer engineer for your project."
If something went wrong
Three common failure modes:
claude: command not found— the npm global install didn't put the binary on your PATH. On Linux/macOS, checknpm bin -gand confirm that directory is in yourPATH. On Windows WSL, make sure you ran the install inside WSL, not Windows cmd.- Authentication hangs or fails — check you have a working Anthropic account and that you can log in at
console.anthropic.com. Auth issues almost always come back to the account, not the CLI. - API errors at the first prompt — billing issue, rate limit, or a network proxy that's interfering. Verify you can reach
api.anthropic.comfrom the shell (curl https://api.anthropic.com).
The full setup guide at docs.anthropic.com has longer troubleshooting trees for less common issues. For most installs, the three steps above are all you need.
Key Takeaways
- 1Claude Code is a terminal-based coding assistant with built-in file operations, terminal access, web search, and MCP server support, available on macOS, Windows WSL, and Linux.
- 2Installation is three steps: install Node.js, run npm install -g @anthropic-ai/claude-code, and run claude to authenticate with your Anthropic account.
- 3Check for an existing Node.js install with npm help before installing — most modern dev machines already have it.
- 4The first invocation of claude walks you through an authentication flow; subsequent runs use the stored auth state and start immediately.
- 5The MCP client support is the part that transforms Claude Code from a generic assistant into a customisable peer engineer tailored to your stack.