First run, login, model selection
Claude Code's first run, login, and model selection cover the steps a developer takes from installing the CLI to authenticating an account and choosing which Claude model will process their requests. On first launch, Claude Code opens an OAuth browser flow so users can sign in with either a Claude.ai subscription (Pro, Max, Team, or Enterprise) or an Anthropic Console API account. The process caches an access token locally so subsequent sessions start immediately without re-authenticating.
Model selection is the choice of which Claude model version—Haiku, Sonnet, or Opus at various point releases—handles your session. This can be set before launch via the --model flag or environment variables, changed interactively during a session with the /model command, or locked down organization-wide through managed policy files. Different models trade off speed, reasoning depth, and token cost, so the right choice depends on the complexity and budget of each task.
Authentication method determines billing: Claude.ai subscription users draw from their plan's shared usage pool, while Console users are billed per token against API credits. The two flows are separate and choosing the wrong one at login is a common early mistake.
When you’d use it
- ◆First-time setup for a solo developer — A developer with a Claude Pro subscription installs Claude Code for the first time, authenticates via browser OAuth, and uses the default Sonnet model to fix a small bug in a Python script without any additional configuration.
- ◆Multi-model workflow for architecture then implementation — An engineer uses Opus 4.8 to design the high-level architecture of a new data pipeline, then switches to Sonnet mid-session to implement the individual components, conserving usage quota while still leveraging deep reasoning where it matters.
- ◆Team deployment with enterprise policy controls — An enterprise admin uses the `availableModels` setting in a managed policy file to restrict team members to Sonnet only, preventing accidental Opus usage and keeping costs predictable across the organization.
- ◆CI/CD pipeline with API key authentication — An automation engineer exports `ANTHROPIC_API_KEY` into CI environment variables so Claude Code can run non-interactively in a GitHub Actions pipeline without triggering the OAuth browser flow.
- ◆Cloud provider integration (Bedrock or Vertex) — A team running workloads on AWS uses Claude Code pointed at Amazon Bedrock by setting `ANTHROPIC_BEDROCK_BASE_URL` and selecting the full model name explicitly, since model aliases resolve to older versions on Bedrock than on the direct Anthropic API.
What changed recently
- ◆2026-04 — Native binary installer (`curl -fsSL https://claude.ai/install.sh | bash`) became the standard installation method, replacing npm global install, which is now deprecated. Existing npm installations can migrate with `claude install`.
- ◆2026-05 — Claude Opus 4.8 became generally available and is now the default Opus alias on the Anthropic API. Requires Claude Code v2.1.154 or later. Run `claude update` to access it.
- ◆2026-05 — On the Anthropic API, 'opus' resolves to Opus 4.8 and 'sonnet' resolves to Sonnet 4.6. On Bedrock and Vertex, 'opus' resolves to Opus 4.6 and 'sonnet' to Sonnet 4.5; newer models require explicit full model names or the ANTHROPIC_DEFAULT_OPUS_MODEL / ANTHROPIC_DEFAULT_SONNET_MODEL environment variables.
- ◆2026-05 — Effort levels were added to model configuration. Default effort is 'high' for Opus 4.8, Opus 4.6, and Sonnet 4.6, and 'xhigh' for Opus 4.7. Effort resets to the model's default when switching models within a session.
This is the short version
The full chapter has three worked examples, the common pitfalls, and the workflow that makes it pay — plus the other 84 features, kept current.
Get Claude Master — $97 →