Mastery — models, cost, IDE
Pick the right model, manage cost, and integrate with your editor
⏱ Est. ~9 min
01 · Read
The final piece of Claude Code mastery is optimization — picking the right model for each task, controlling cost, and using IDE integrations that fit your workflow.
Most developers never think about this. They use the default model for everything, don't track cost, and only use the terminal. But the difference between a good Claude Code user and a great one is knowing when to use Opus vs Sonnet, when to clear vs compact context, and when to switch from the terminal to a VS Code extension.
Key points
- Model selection: different models for different tasks
- Cost awareness: track and optimize token usage
- IDE integration: graphical alternatives to the terminal
- Goal: maximum productivity at minimum cost
02 · Read
Claude Code gives you access to multiple models, each with different strengths:- Sonnet — The workhorse. Fast, capable, cost-effective. Use it for everyday coding, refactors, bug fixes, and most tasks. This should be your default. - Opus — The heavy hitter. Better at complex architectural decisions, multi-step planning, and reasoning about subtle bugs. More expensive, but worth it for hard problems. - Haiku — The speed champion. Fast and cheap. Use it for simple subagent tasks, background operations, and quick questions.
The /effort command lets you set the effort level (low, medium, high), which controls how deeply Claude reasons about your request. Lower effort is faster and cheaper for simple tasks; higher effort gives deeper reasoning on complex problems.
Switch models any time with /model. You're not locked in.
Key points
- Sonnet: everyday work, best cost/capability balance (default)
- Opus: complex reasoning, architecture, hard bugs
- Haiku: simple tasks, subagents, quick questions
- Effort level: low/medium/high controls reasoning depth
- Switch any time with /model
03 · Code example
Use /model to switch models and /cost to track spend.
Model and cost commands
/model sonnet # Switch to Sonnet (daily coding)
/model opus # Switch to Opus (complex problems)
/model haiku # Switch to Haiku (quick tasks)
/effort low # Faster, cheaper reasoning for simple tasks
/effort medium # Balanced reasoning (default)
/effort high # Deeper reasoning for complex problems
/cost # Show current session cost
/context # Show what's consuming context space
Switch models as the task changes. Start a complex architecture discussion with Opus, then switch to Sonnet for implementation. Use /cost to stay aware of spend — a typical developer runs $6-12/day. Heavy refactor sessions cost more; quick fixes cost less.
04 · Read
Here are the most effective cost-saving strategies, ranked by impact:
1. Clear between unrelated tasks — /clear resets your context. A clean context means Claude processes fewer tokens per message. 2. Use subagents for verbose work — Test output, logs, and investigations fill up context fast. Delegate them to a subagent. 3. Move specialized knowledge to skills — CLAUDE.md loads every session. Skills only load when called. Move detailed workflows into skills. 4. Pick the right model — Haiku for simple tasks costs a fraction of Opus. Don't use Opus to rename a variable. 5. Compact strategically — /compact with a focus hint keeps what matters and drops the rest. 6. Limit MCP servers — Each server's tool definitions consume context. Disable ones you don't use.
The biggest waste is the "kitchen-sink session" — one conversation trying to do everything. Clear between tasks.
Key points
- /clear between unrelated tasks (biggest impact)
- Subagents for verbose work (tests, logs, investigations)
- Skills beat CLAUDE.md for specialized knowledge
- Right model for the right task
- /compact with focus hint when context fills
- Disable unused MCP servers
05 · Read
Claude Code isn't just a terminal tool. It integrates with the editors you already use:VS Code extension — A graphical chat panel inside VS Code. You get inline diffs (side-by-side comparison of changes), @-mention for files and line ranges (@auth.ts#5-10), plan mode with a visual markdown editor, and session management. Install from the Extensions marketplace — search 'Claude Code'.
JetBrains plugin — Integrated chat for IntelliJ, WebStorm, PyCharm, and other JetBrains IDEs. Same code context awareness, diff views, and remote development support.
Both share settings with the CLI through ~/.claude/settings.json. Your hooks, permissions, and skills work everywhere.
Key points
- VS Code: graphical chat, inline diffs, @-mention, plan mode
- JetBrains: integrated chat for IntelliJ, WebStorm, PyCharm
- CLI and IDE extensions share settings
- Hooks, permissions, and skills work in all environments
06 · Quiz
You're doing a straightforward rename refactor across 3 files. Which model should you use?
- Opus — always use the most capable model
- Haiku — cheapest option
- Opus (high effort) — let Opus plan the refactor first
- Sonnet — best capability/cost balance for routine tasks
07 · Read
Halftime — you already know how to pick a model
In the first half you learned: Claude Code has different models (Sonnet / Opus / Haiku), and different tasks call for different brains. You just answered which one to use for a refactor.
The second half builds on this in two ways: a dragSort exercise sorting different tasks into the right model, then a more nuanced scenario — debugging a race condition — to see if you can tell which tasks need stronger reasoning.
Finally you'll learn the /cost command, which tells you how many tokens a session has burned so you can manage your budget in practice.
Key points
- Sonnet is the default, fits most dev tasks
- Opus fits scenarios that need deep reasoning (complex refactors, debugging, design decisions)
- Haiku is fast and cheap, fits simple batch tasks
- /model switches models, /cost shows spend
08 · Drag to sort
Sort each task by the recommended model.
(This section is interactive — please enable JavaScript.)
09 · Read
You've finished the entire Claude Code advanced track. From Level 8's basic commands, to Level 9's skills, Level 10's MCP, Level 11's context management, to Level 12's advanced features now.
You understand subagents for delegation, worktrees for parallel work, hooks and permissions for customization, headless mode for automation, and model selection for cost optimization. These are the tools that separate casual users from power users.
The next level shifts from Claude Code-specific to general junior engineer patterns — debugging, deploying, working like a professional. Every Claude Code skill you've learned makes those lessons more effective.
Key points
- You've finished the full Claude Code track (Levels 8-12)
- Subagents, worktrees, hooks, headless mode, cost optimization
- These are power-user skills that compound over time
- Next stop: junior engineer mode — the final level
10 · Quiz
You need to debug a subtle race condition in auth code. Which model should you switch to?
- Opus — better at reasoning about complex, subtle bugs
- Haiku — fastest and cheapest
- Sonnet — the default for everyday work
- Opus (high effort) — deep reasoning for planning, Sonnet for execution
11 · Fill in the blank
To see how much your current Claude Code session has spent so far, type the slash command /_____
Other lessons in this chapter
⚠ The full interactive experience needs JavaScript. Please enable it and reload.
※ This is an independent Traditional Chinese teaching project — not an official Anthropic product. Claude™ is a trademark of Anthropic, PBC.