← LearnClaude Code · Setup

Claude Code First Time Setup for Solo Developers

To set up Claude Code for the first time, install it using the native installer, run `claude` in your project directory, and sign in through the browser OAuth flow using either your Claude.ai subscription or Anthropic Console credentials. After authentication, Claude Code is ready immediately with Sonnet as the default model.

Setting up Claude Code as a solo developer takes about five minutes from a blank terminal to your first working session. Run the native installer, launch the CLI, authenticate once through a browser window, and you are ready to start describing tasks in plain English. This guide walks through every step, explains the two authentication paths, and shows you how to pick the right model for the work at hand.

How Do You Install Claude Code for the First Time?

The official and recommended way to install Claude Code is with the native installer. Open a terminal on macOS, Linux, or Windows Subsystem for Linux and run:

curl -fsSL https://claude.ai/install.sh | bash

That single command downloads and installs the Claude Code binary. Do not use sudo npm install -g — the npm installation path is deprecated, causes permission errors, and has worse auto-update reliability. If you already installed via npm, the source material notes you can migrate to the native binary by running claude install.

Once installation finishes, navigate to the project you want to work in:

cd ~/my-project

Then launch Claude Code by typing:

claude

See the official Claude Code setup docs for platform-specific notes.

What Happens on the Very First Launch?

On first launch, Claude Code opens an OAuth browser flow automatically. A browser window appears and prompts you to sign in. If the browser does not open on its own, the terminal displays a login URL — press c to copy it and paste it into your browser manually.

After you sign in, the browser redirects back to the CLI and the terminal prints a confirmation that authentication succeeded. Claude Code then shows a ready prompt. Your access token is cached locally, so every subsequent session starts immediately without repeating the browser flow.

This is described in the first day in Claude Code guide as the standard path for new users.

Which Login Method Should a Solo Developer Choose?

There are two separate authentication paths, and choosing the wrong one at the login screen is one of the most common early mistakes. The choice also determines how you are billed.

  • Claude.ai subscription (Pro, Max, Team, or Enterprise): Usage is drawn from your plan's shared monthly pool. This is the right choice if you already pay for Claude.ai and want a single subscription covering both the web interface and Claude Code.
  • Anthropic Console / API key: Usage is billed per token against API credits. This is the right choice when you need pay-per-token billing, want to run Claude Code in automated pipelines without browser interaction, or need separate billing workspaces per project.

If you accidentally select the wrong method, run /logout to end the session, then run claude again and select the correct account type. See Claude Code authentication docs for details on both flows.

One important gotcha: if you have an ANTHROPIC_API_KEY exported in your shell environment, it will silently override your subscription login. Run /status inside Claude Code to check which authentication method is active. If it shows an API key when you expected your subscription, run unset ANTHROPIC_API_KEY and remove the export from your shell profile, then relaunch.

How Do You Handle Login in WSL2, SSH, or a Container?

In WSL2, SSH sessions, and Docker containers, the browser cannot redirect back to Claude Code's local OAuth callback server. Instead of the terminal being unblocked automatically, the browser shows a short alphanumeric code. Here is what to do:

  1. Sign in with your credentials in the browser as normal.
  2. Copy the short code displayed in the browser.
  3. Return to the terminal, which shows the prompt Paste code here if prompted:
  4. Paste the code and press Enter.
  5. The terminal confirms authentication and shows the ready prompt.

This is expected behavior in those environments, not an error. Knowing about the manual code path prevents getting stuck on your very first login.

What Model Does Claude Code Use by Default, and How Do You Change It?

After authentication, Claude Code uses Sonnet as the default model. For the large majority of everyday solo developer tasks — bug fixes, refactoring, writing tests, explaining code — Sonnet offers a good balance of speed, quality, and cost, and you do not need to change anything to get started.

When you need deeper reasoning for a harder problem, you can switch models at any point:

  • Type /model with no argument to open an interactive picker listing available models.
  • Type /model <model-name> to switch directly. For example, to switch to a specific Opus model: /model claude-opus-4-8.
  • Conversation history is preserved when you switch, so you do not lose context.

A practical pattern for solo developers: start a session on Sonnet, switch to Opus when you hit a genuinely hard architectural or debugging problem, then switch back to Sonnet for implementation. This conserves your usage quota without losing the reasoning work you already did.

Haiku is also available for tasks where speed and low cost matter more than depth — for example, scanning a large unfamiliar codebase to map its structure before doing targeted work with a more capable model.

Step-by-Step: Your First Claude Code Session from Scratch

  1. Install: Run curl -fsSL https://claude.ai/install.sh | bash in your terminal.
  2. Navigate: Run cd ~/my-project to move into your project directory.
  3. Launch: Type claude to start Claude Code.
  4. Authenticate: A browser window opens. Sign in with your Claude.ai credentials (Pro/Max/Team/Enterprise) or your Anthropic Console credentials, depending on your plan.
  5. Handle WSL2/SSH if needed: If the browser cannot redirect back, copy the code shown in the browser and paste it at the Paste code here if prompted: terminal prompt.
  6. Confirm ready: The terminal shows a ready prompt. You are now on the default Sonnet model.
  7. Describe your task: Type a plain-English description of what you want done, for example: Fix the off-by-one error in the loop in utils.py.
  8. Review and accept: Claude Code proposes a diff. Review it and accept or reject the change.

When Should You Use Opus Instead of Sonnet?

Sonnet is the right default for most solo developer work. Switch to Opus when a task genuinely requires deep multi-step reasoning — complex architectural design, difficult debugging across many files simultaneously, or redesigning a concurrent system. Expect higher token cost and slightly slower responses with Opus.

A common mistake is leaving Opus active after finishing a hard task and then burning through usage quota on routine work. Develop the habit of running /model to switch back to Sonnet once the complex reasoning is done.

What Are the Most Common First-Run Mistakes to Avoid?

  • Installing with npm instead of the native installer. Use curl -fsSL https://claude.ai/install.sh | bash for all new installs.
  • Picking the wrong login method. Subscription and Console billing are completely separate. Use /logout and restart if you choose wrong.
  • A shell environment variable silently overriding your subscription. Run /status to verify which authentication method is active.
  • Getting stuck on the WSL2 browser redirect. Copy the code from the browser and paste it at the terminal prompt — this is normal, not a bug.
  • Forgetting to switch back from Opus after complex work. Sonnet handles the vast majority of everyday coding tasks well and at lower cost.

Is There Anything Special About Model Aliases on Bedrock or Vertex?

If you are using Claude Code pointed at Amazon Bedrock or Google Vertex rather than the direct Anthropic API, be aware that model aliases like opus and sonnet resolve to different — and older — model versions on those providers than they do on the Anthropic API. To use a specific model version on Bedrock or Vertex, specify the full model name explicitly rather than relying on an alias, or set the appropriate environment variables for default model selection. This is not a concern for most solo developers using a standard Claude.ai subscription, but it matters if your workflow involves cloud provider integrations.

Quick Reference: Authentication and Model Choices

Situation Recommended Choice Why
Solo dev with Claude.ai Pro/Max Claude.ai subscription login Single subscription covers web and CLI; usage from shared monthly pool
CI/CD pipeline or automation Console API key authentication No browser interaction needed; pay-per-token billing
Everyday coding tasks Sonnet (default) Good balance of speed, quality, and cost for most work
Complex architecture or hard debugging Opus Deeper multi-step reasoning; higher cost, use selectively
Scanning a large unfamiliar codebase Haiku Fast and affordable for exploratory, low-complexity work

Frequently asked questions

Do I need an API key to use Claude Code as a solo developer?

No. If you have a Claude.ai subscription (Pro, Max, Team, or Enterprise), you can authenticate through the browser OAuth flow and draw usage from your subscription's shared pool. An API key is only needed if you want pay-per-token Console billing or non-interactive use in pipelines.

What model does Claude Code use by default after first login?

Claude Code uses Sonnet as the default model after authentication. Sonnet is recommended for the large majority of everyday coding tasks. You can switch to Opus for complex reasoning or Haiku for fast, low-cost exploratory work using the /model command.

Why is my Claude.ai subscription not being used even though I logged in?

An ANTHROPIC_API_KEY environment variable in your shell can silently override your subscription login. Run /status inside Claude Code to check which authentication method is active. If it shows an API key, run `unset ANTHROPIC_API_KEY`, remove the export from your shell profile, and relaunch Claude Code.

How do I log in to Claude Code from WSL2 or an SSH session?

In WSL2 and SSH environments, the browser cannot redirect back to the CLI automatically. After signing in through the browser, copy the short code displayed on the page and paste it at the 'Paste code here if prompted:' terminal prompt. This is expected behavior, not an error.

Can I switch models mid-session without losing my conversation history?

Yes. Type /model with no argument to open an interactive picker, or /model followed by a model name to switch directly. Conversation history is preserved when you switch, so you can move from Sonnet to Opus for a hard problem and back again without losing context.

Is the npm install method still supported?

The npm global install method is deprecated and should not be used for new installations. Use the native installer instead: curl -fsSL https://claude.ai/install.sh | bash. If you have an existing npm installation, you can migrate it by running `claude install`.

Go deeper

First run, login, model selection is one of 85 features in Claude Master — the independent, always-current manual with worked examples, the pitfalls, and the workflows that make Claude pay.

Get Claude Master — founding price

Independent product. Not affiliated with or endorsed by Anthropic. "Claude" is a trademark of Anthropic, used here only to describe the subject of this guide.

CLAUDEMASTER
An independent publication.
Independent product. Not affiliated with or endorsed by Anthropic. “Claude” is a trademark of Anthropic, used here only to describe the subject of this manual.
© 2026 Claude Master — All rights reserved.