Blog

Claude Code Setup for Beginners: Install & Configure in 2026

Quick Answer

Claude Code is Anthropic's agentic coding tool that runs in your terminal. To install it in 2026: make sure you have Node.js 22 LTS (18+ minimum), run npm install -g @anthropic-ai/claude-code, authenticate with a Claude subscription or API key, and run claude in any project folder. For the smoothest beginner path, point Claude Code at a gateway like TeamoRouter so one API key handles authentication, prompt caching keeps costs low, and network restrictions do not get in the way. This guide walks through every step, including Windows, common errors, and your first session.

What Is Claude Code?

Claude Code is a command-line agent that works directly inside your project. Unlike the claude.ai web chat, it has access to your filesystem, git history, and shell — so it can read your codebase, edit files, run tests, and create commits while you supervise.

Think of it as a pair programmer that lives in the terminal: you describe a task, it explores the code, makes changes, runs commands, and iterates until the job is done. In 2026 it supports multiple Claude models (Sonnet, Opus, Haiku), MCP servers for connecting to external tools, and full git integration.

Prerequisites

Before installing, confirm three things:

1. Node.js 18+ (Recommended: 22 LTS)

Claude Code is an npm package. The minimum is Node.js 18, but Node.js 22 LTS is recommended — it is noticeably faster for CLI operations, and recent Claude Code releases are built against it. Check your version:

bash
node --version

If you need to install or upgrade, use a version manager (recommended) or Homebrew:

bash
# macOS / Linux via nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
nvm install --lts

# macOS via Homebrew
brew install node

On Windows, install Node.js from nodejs.org or via winget install OpenJS.NodeJS.LTS.

No-Node option: Anthropic also offers a native installer that does not require Node.js: curl -fsSL https://claude.ai/install.sh | bash. If you want to avoid managing Node entirely, use that instead.

2. An Anthropic Account with Access

Claude Code requires a paid Claude plan (Pro, Max, Team, or Enterprise) or API credits in the Anthropic Console. The free claude.ai plan does not include Claude Code. If you cannot pay Anthropic directly (no foreign card, unsupported region), a gateway that accepts local payment is the practical workaround — see How to Pay for Claude When Your Card Gets Declined.

3. Git

Claude Code uses git for change tracking and reverts. Any recent git (2.30+) is fine. Check with git --version.

Step 1: Install Claude Code

Install globally with npm:

bash
npm install -g @anthropic-ai/claude-code

Verify the installation:

bash
claude --version

You can also try it without installing:

bash
npx @anthropic-ai/claude-code

Common Install Errors

Error Fix
EACCES: permission denied (macOS/Linux) Configure a local npm prefix instead of using sudo: npm config set prefix ~/.npm-global, add export PATH="$HOME/.npm-global/bin:$PATH" to your shell profile, then reinstall
EBADENGINE warning about Node version Install runs anyway (Claude Code ships a native binary), but upgrade to Node 22 LTS to be safe
Command not found after install The global npm bin directory is not on your PATH — add it as above

Step 2: Authenticate

You have two authentication options:

Option A — Claude Subscription Login (Simplest)

Run claude and choose "Login to Claude" in the onboarding prompt. This opens a browser to authenticate with your Claude account (Pro/Max). The session is then linked to your subscription's session limits.

Option B — API Key (Most Flexible)

Export an Anthropic API key, then configure the base URL:

bash
export ANTHROPIC_API_KEY="your-api-key"
export ANTHROPIC_BASE_URL="https://api.anthropic.com"
claude

For a persistent setup, add these to ~/.zshrc (macOS/Linux) or set them in Windows system environment variables.

Option C — Gateway Key (Best for Restricted Regions and Cost)

If you are outside Anthropic's supported regions, or want to keep costs predictable, point Claude Code at a gateway:

bash
export ANTHROPIC_API_KEY="your-teamorouter-key"
export ANTHROPIC_BASE_URL="https://gateway.teamorouter.com"
claude

The same key works for Claude Code, Codex, and Gemini CLI. Because the gateway preserves prompt caching and applies floating-rate discounts, effective per-session cost drops significantly — see Claude Subscription vs API: Which Is Cheaper in 2026? for the math.

Step 3: Windows-Specific Notes

Claude Code runs on Windows 10/11 through Windows Terminal, PowerShell, or Git Bash.

  • Use Windows Terminal — it is the most reliable shell for Claude Code's interactive interface.
  • Prefer Git Bash or WSL2 for the best git integration. Some shell-specific features (like certain git hooks) work most reliably in Git Bash or WSL (Windows Subsystem for Linux).
  • For WSL2, install Claude Code inside the Linux environment, not on the Windows side.

Step 4: Your First Session

Create a project folder, then start Claude Code inside it:

bash
mkdir my-project && cd my-project
claude

The first launch walks you through any remaining setup (login, MCP server consent, permissions). Then try your first task:

text
> Write a Python script that reads a CSV file and prints summary statistics.

Claude Code will explore the folder, create the script, and may offer to run it. When it asks for permission to write or run commands, review the change and approve.

Useful first commands:

  • /help — see all commands
  • /model — switch models (Sonnet for everyday work, Opus for complex architecture, Haiku for quick boilerplate)
  • /undo — revert the most recent change
  • /clear — start a fresh conversation context
  • /cost — show token usage and cost for the session

Step 5: Add a CLAUDE.md File

Create a CLAUDE.md file in the project root describing conventions — coding style, framework, testing commands, architecture notes. Claude Code reads it automatically at session start, which dramatically improves output quality:

markdown
# Project: my-project

## Stack
- Node.js 22 + Express, tests with Vitest

## Conventions
- Use async/await, never callbacks
- One component per file
- Run `npm test` before committing

This is the single highest-leverage step for beginners: a good CLAUDE.md eliminates the need to re-explain your project in every prompt.

Step 6: Connect MCP Servers (Optional but Powerful)

The Model Context Protocol (MCP) lets Claude Code talk to external tools — databases, issue trackers, documentation, web search, your browser. For beginners, two servers give the most value immediately:

  • Filesystem MCP — safe, structured access to folders outside the project.
  • Web search MCP — lets Claude pull current documentation and Stack Overflow answers mid-task.

Claude Code manages MCP servers through an interactive prompt (/mcp), or you can declare them in your config file:

json
{
  "mcpServers": {
    "websearch": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-{provider}"]
    }
  }
}

MCP is the difference between a coding agent that guesses and one that verifies. Start small — one server at a time — so you can see exactly what each connection enables.

Common Beginner Mistakes to Avoid

  1. Running outside a git repository. Without git, a wrong multi-file edit is hard to undo. Always git init first.
  2. Disabling permissions too early. The ask-before-write and ask-before-execute prompts are training wheels worth keeping until you trust the agent.
  3. Ignoring prompt caching. Re-sending a large codebase on every turn multiplies cost. A gateway that preserves caching keeps sessions cheap.
  4. Using one prompt for everything. Vague prompts produce vague work. Include the file, the failure, and the acceptance criteria.
  5. Not writing CLAUDE.md. Skipping the project context file means re-explaining conventions in every session.

Step 7: Next Steps

  1. Try a real task. Fix a bug, add a validation rule, or write a unit test — real work teaches faster than toy examples.
  2. Add more MCP servers. Connect your issue tracker or database once the basics feel comfortable.
  3. Integrate with your editor. Run Claude Code alongside VS Code or JetBrains — the terminal workflow complements editor AI tools rather than replacing them.
  4. Explore the gateway. If you started with a direct Anthropic key, switching to TeamoRouter gives you unified access across Claude, Codex, and Gemini with a single key, plus caching and global availability.

FAQ

Is Claude Code free?

The tool itself is free to install, but you need a paid Claude plan or API credits to use it. A typical coding session costs $0.50 to $5.00 with prompt caching enabled; without caching (e.g., via a low-quality relay) costs can be 5-10x higher. A gateway that guarantees >99% cache-hit keeps you at the low end.

What is the difference between Claude Code and Claude Pro?

Claude Pro ($20/month) is a subscription for the claude.ai web/app interface. Claude Code is the terminal agent that, as of 2026, is included in paid plans and also works with API billing. Claude Code is more powerful for software development because it has filesystem access, runs commands, and integrates with git.

Can I use Claude Code on Windows?

Yes — Windows 10 and 11, via Windows Terminal, PowerShell, or Git Bash. The npm install is identical across platforms. Git Bash or WSL2 gives the best git integration.

Do I need a credit card to start with a gateway?

No. TeamoRouter accepts Alipay and WeChat Pay with a low minimum top-up, so you can start without any foreign card.

How do I switch models?

Use the /model command in-session, or set the ANTHROPIC_MODEL environment variable. Claude Code defaults to a balanced model (Sonnet) and lets you escalate to Opus for hard reasoning tasks.

What happens if Claude Code makes a mistake?

Always work in a git repository. Use /undo for the most recent change, or git checkout . to revert everything. Keep the permission system enabled until you are comfortable — it is your safety net.

Get Started

  1. Sign up for TeamoRouter and get an API Key
  2. Set ANTHROPIC_API_KEY and ANTHROPIC_BASE_URL to the gateway values
  3. Run claude and start your first AI-powered coding session

Get Your Free Claude Code Setup →

Access Claude, Codex, and Gemini stably through TeamoRouter.

Ready to connect?Log in · top up · create an API key — three steps to start.
Claude Code Setup for Beginners: Install & Configure in 2026 · TeamoRouter