AI Coding
Install Claude Code: What You Should Know
A calm walkthrough of installing Claude Code: prerequisites, the install command, authentication, first run, and the gotchas that trip people up.
Installing Claude Code means getting a terminal agent onto your machine, authenticating it against your Anthropic account, and pointing it at a repo. The core steps are: confirm your prerequisites, run the install command, authenticate in the browser, then launch it inside a project directory. Most friction comes from auth and permissions, not the install itself.
Installers and commands change. As of May 2026, the flow below matches the current setup, but the exact command and supported platforms shift between releases. Always cross-check the official Claude Code docs before you run anything from a blog post, including this one.
What do you need before installing Claude Code?
Claude Code is a command-line tool, so the prerequisites are the usual terminal-tool checklist. Before you install, make sure you have these in place.
- A supported operating system. Claude Code runs on macOS, Linux, and Windows (historically via WSL on Windows, verify current native support in the docs).
- A recent Node.js runtime if you install via the package manager path. Many releases ship a standalone installer too, so check which path the docs recommend now.
- An Anthropic account with access to Claude Code. Consumption ties into Pro and Max subscription plans, with API-billed paths for teams. Plan details rotate, so confirm before budgeting.
- A terminal you actually use. The agent lives in your shell. If you are comfortable in
tmux, iTerm, or Windows Terminal, you are ready.
You do not need to leave your editor. Claude Code runs alongside whatever editor you already use, it drives the repo from the shell while you keep your usual setup open in another pane.
How do you install Claude Code?
The install itself is a single command in most setups. The pattern follows the same shape as other CLI tools: fetch the package, expose a binary on your PATH, then invoke it.
The general flow looks like this:
- Run the install command the docs specify for your platform. Historically this has been an
npm install -gfor the global package or a standalone install script. Use the current one, do not paste an old command from memory. - Confirm the binary is on your
PATH. Open a new shell and run the version check the docs list. If the command is not found, your shell profile probably is not sourcing the install location yet. - Move into a project directory. Claude Code operates on the repo you launch it from.
cdinto a project before you start it the first time. - Launch it with the documented start command. On first run it will walk you through authentication.
If step 2 fails, the fix is almost always a PATH or shell-restart issue, not a broken install. Open a fresh terminal session so your updated profile loads.
How does authentication work on first run?
The first launch hands off to a browser-based login. The agent prints a URL or opens one, you sign in to your Anthropic account, approve the connection, and control returns to the terminal. After that, your session is remembered locally so you are not logging in every time.
A few things worth knowing:
- The auth token lives on your machine. Treat it like any other credential. On a shared box, log out when you are done.
- Team and enterprise setups differ. Organizations using SSO or API-key billing follow a different path. If you are in a managed environment, ask whoever administers your Anthropic org before improvising.
- Network-restricted machines need a plan. A locked-down corporate network may block the login flow or the API endpoints. Sort proxy and allowlist questions out before you start, not after.
Lab Notes, start with the boundary, then run the agent. Before you give Claude Code a real task, decide what it is allowed to do on this machine. The agent can read every file in the repo and, if you permit it, run shell commands. Scope that on day one rather than discovering it mid-task.
What should your first task be?
Resist the urge to point a fresh agent at your most important repo and ask for something huge. Build trust on a low-stakes task first, the same way you would with a new teammate.
A good first run looks like this. Open a small project or a scratch repo. Ask the agent something concrete and verifiable, “explain what this module does,” or “add a test for this function and run it.” Watch how it reads files, proposes edits, and reports results. Read the diff before you accept anything.
This matters because the agent’s default posture is to do the work and show you the diff, not to ask permission at every keystroke. That is the point of a terminal agent, and it is also why the review habit is non-negotiable. If you want to understand how that posture compares to an editor-native tool that surfaces every change inline, our Claude Code vs Cursor comparison breaks down the ergonomics of both.
Common install and setup gotchas
Most setup problems cluster into a handful of repeat offenders. Knowing them in advance saves an hour.
- “Command not found” after install. Almost always a
PATHor stale-shell issue. Open a new terminal. - Permission denied on a global install. On macOS and Linux this usually means a permissions tangle in your global package directory. The docs recommend fixing the directory ownership rather than reaching for
sudoon every install. - Auth loop in the browser. Clear the relevant cookies, confirm you are signing into the right Anthropic account, and retry. Corporate SSO can complicate this.
- The agent cannot see expected files. You launched it from the wrong directory.
cdinto the repo root and relaunch. - Surprising shell commands. If the agent proposes a destructive command, that is the review valve working. Read before you approve, and tighten its permissions if needed.
None of these mean the tool is broken. They are the normal seams of installing any agent that touches your filesystem and your account. Once the agent is running cleanly, the official documentation covers the configuration and permission controls worth learning next.
How do you keep an installation healthy over time?
Installing the agent is a one-time event; keeping it healthy is ongoing, because the tool updates often and the environment around it drifts. A few habits keep the setup from quietly rotting.
Stay current deliberately. Because the CLI ships frequent updates, an install you set up months ago may lag behind documented behavior. Update on the cadence the docs recommend rather than letting the version drift far, and skim the release notes when you do, agent defaults and permission behavior occasionally change in ways worth knowing before they surprise you mid-task.
Keep your permissions intentional. The first-run scoping is not a set-and-forget decision. As you give the agent more real work, revisit what it is allowed to run. Tighten the rules around destructive commands if you find yourself approving them on autopilot, and loosen them only on workflows where your tests give you a genuine safety net. The point is to keep the trust level matched to the task, not to drift toward “approve everything” because the prompts got annoying.
Mind the machine boundary. On a personal laptop the defaults are usually fine. On a shared or managed machine, treat the local auth token and any cached context as credentials: log out when you are done, and follow whatever your organization’s policy says about API billing, SSO, and network allowlists. A clean install on a locked-down corporate box is mostly a matter of sorting those constraints out first.
Related reading
- Claude Code vs Cursor: Choosing Your AI Coding Tool, terminal agent versus editor-native assistant, compared by workflow.
- Kotlin Project Structure for Beginners, clean boundaries that make agent-driven refactors safer.
- ObjectSerializer Legacy Alternatives, the kind of migration where a terminal agent earns its keep.
Sources
- “Claude Code documentation”, Anthropic, official installation, authentication, and permission documentation.
- “Claude Code”, Anthropic, official product page and plan overview.