How to Change the Model in Claude Code

Claude Code — Anthropic's AI-powered coding assistant that runs in your terminal — doesn't lock you into a single model. You can switch between available Claude models depending on what your task demands. Whether you need faster responses for quick edits or deeper reasoning for complex refactoring, understanding how model selection works gives you meaningful control over your workflow.

What "Changing the Model" Actually Means

Claude Code uses Anthropic's API under the hood. When you run Claude Code, it sends your requests to a specific Claude model — such as Claude Opus, Claude Sonnet, or Claude Haiku. These models sit on a spectrum:

  • Opus — highest capability, strongest at complex reasoning, architecture decisions, and multi-step problem solving
  • Sonnet — balanced performance, strong coding ability with faster response times
  • Haiku — lightweight and fast, well-suited to simple completions, quick lookups, and repetitive tasks

Switching the model means directing Claude Code to route your requests through a different one of these engines. The interface stays the same — only the model powering your responses changes.

How to Change the Model in Claude Code

Method 1: The --model Flag at Launch

The most direct way is to pass the --model flag when starting a session: