Barron & Folly
Technology||9 min read

Claude Code and AI Model Selection: A Practical Guide to Opus, Sonnet, and Haiku

Not every AI task requires the same model. Claude Code gives you access to three distinct model tiers — Opus, Sonnet, and Haiku — each optimized for different types of work. Understanding when to use each one is the difference between burning tokens and building efficiently.

Claude Code and AI Model Selection: A Practical Guide to Opus, Sonnet, and Haiku
AI coding tools have evolved past the point of novelty. They're operational infrastructure now. But most teams treat every AI interaction the same way — throwing their most expensive model at every task regardless of complexity. That's like hiring a senior architect to change a lightbulb. Claude Code, Anthropic's terminal-based AI coding agent, solves this by giving you access to three model tiers — Opus, Sonnet, and Haiku — each designed for a fundamentally different class of work. The teams and execution engines that understand model selection ship faster, spend less, and build more reliable systems than those running everything through a single model.

What Is Claude Code

Claude Code is an agentic coding tool that lives in your terminal. Unlike browser-based AI assistants that operate in isolation, Claude Code connects directly to your codebase. It reads your files, understands your project structure, writes and edits code, runs shell commands, manages git workflows, and iterates until the task is complete — all through natural language conversation. You install it, authenticate through your browser, navigate to any project directory, and run claude in your terminal. From there, you're working with an AI agent that has full context of your repository. It's not autocomplete. It's not a chatbot pasted into a code editor. It's an autonomous execution agent that operates inside your actual development environment. For teams building production systems, this distinction matters. Claude Code doesn't just suggest — it executes.

The Three Model Tiers Explained

Anthropic's Claude model family consists of three tiers, each optimized for different workloads. Opus is the most capable model in the family. It delivers the deepest reasoning, handles the most complex multi-step problems, and excels at tasks where missing an edge case costs hours of debugging downstream. It's slower and more expensive, but when you need comprehensive analysis or architectural decisions, Opus is the model that catches what others miss. Sonnet is the balanced workhorse. Anthropic's own recommendation is to start with Sonnet if you're unsure which model to use. It handles the vast majority of coding tasks — building features, refactoring, debugging, writing tests — with strong reasoning and fast enough response times for real-time collaboration. For most daily development work, Sonnet delivers roughly ninety percent of Opus's capability at significantly lower cost. Haiku is the speed specialist. It's the fastest and most affordable model in the lineup, purpose-built for high-throughput, well-defined tasks where execution speed matters more than deep analysis. Scaffolding components, generating boilerplate, running simple transformations, and handling classification tasks are where Haiku shines.

When to Use Each Model in Practice

The biggest efficiency gain in any AI-assisted workflow is routing each task to the right model. Here's how that breaks down in practice. Use Opus for architectural decisions. When you're designing system architecture, planning a major refactor, reviewing complex pull requests before merge, or debugging issues that span multiple files and layers of abstraction — Opus is your safety net. The extra reasoning depth prevents downstream mistakes that cost far more than the token difference. Use Sonnet for daily development. Feature implementation, bug fixes, writing tests, code reviews, documentation, and most multi-file edits fall squarely in Sonnet's range. It's responsive enough for real-time iteration and capable enough that most problems won't outgrow it. This is the model you'll use eighty percent of the time. Use Haiku for defined, repetitive tasks. Generating boilerplate, scaffolding UI components from established patterns, bulk file transformations, quick data extraction, and any task where the solution space is clear and speed matters more than depth. Haiku excels when you know exactly what you need and just need it done fast. The pattern is simple: Haiku builds the scaffolding. Sonnet writes the logic. Opus reviews the architecture. Teams that internalize this model produce more output at lower cost than teams that default to a single model for everything.

Essential Claude Code Features for New Users

A sleek monitor displaying code in a dark room with amber glow — representing the Claude Code development experienceBeyond model selection, Claude Code includes features that compound your effectiveness once you learn to use them. Plan Mode is one of the most important features for new users. When you enter Plan Mode, Claude analyzes the problem, outlines a step-by-step approach, shows its reasoning, and waits for your approval before executing. This is critical for complex tasks where you want visibility into the approach before code gets written. CLAUDE.md is a markdown file at your project root that tells Claude Code how your project works — think of it as onboarding documentation for your AI agent. It should include your project structure, coding conventions, testing patterns, and deployment rules. Run /init to generate a starter version, then refine it as your project evolves. /clear resets your conversation context without losing your CLAUDE.md configuration. Use it often — every time you switch tasks, clear the context so you're not wasting tokens on irrelevant history. Subagents allow Claude Code to spawn parallel workers for independent tasks, dramatically accelerating multi-file operations. And memory lets Claude automatically record and recall important patterns across sessions, building institutional knowledge over time. These aren't convenience features. They're workflow infrastructure that turns a capable AI model into a predictable execution system.

Model Selection in Agentic Workflows

Model selection becomes even more powerful in the context of agentic execution. When AI agents handle entire categories of work — content generation, frontend builds, QA verification, systems integration — the model powering each agent should match the complexity of the work it handles. A content agent generating blog post variants doesn't need Opus-level reasoning. A QA agent running acceptance tests against defined criteria doesn't need it either. But an architecture agent designing the data model for a new client portal absolutely does. This tiered approach is how modern agentic product agencies optimize for both speed and quality. You're not choosing between a fast, cheap model and a slow, expensive one. You're deploying the right model for each task — automatically, at scale, within an orchestration layer that enforces the routing logic. The result is an execution pipeline that ships at Haiku speed, builds at Sonnet quality, and reviews at Opus depth.

Getting Started with the Right Approach

If you're new to Claude Code, here's the practical starting sequence. Install Claude Code and run claude in your project directory. Start with an exploratory prompt like "what does this project do?" to let Claude analyze your codebase. Run /init to generate your CLAUDE.md file. Then start with Sonnet for your first few sessions — it's capable enough to handle most tasks and fast enough to keep your iteration speed high. As you develop intuition for which tasks need more reasoning depth, you'll naturally start routing complex work to Opus and repetitive work to Haiku. The mental model is straightforward: match the model to the task, not the task to the model. This principle extends beyond individual coding sessions. For teams building at scale — whether through internal development or subscription-based execution — model selection is an infrastructure decision that affects speed, cost, and output quality across every task in the pipeline. Get the routing right, and everything downstream accelerates.
Claude Code guideClaude Code tutorialOpus vs Sonnet vs HaikuClaude model selectionAI coding tools

Your backlog isn’t a strategy.

Subscribe to an execution engine that ships software, systems, and brand infrastructure — continuously.

Deploy Your Infrastructure