Claude
Anthropic's Claude model family — when to use Opus, Sonnet, or Haiku, and how pricing and usage limits work.
Anthropic’s Claude family offers models optimised for different points on the intelligence / speed / cost curve. Pick based on what you need most for the task at hand.
Models
| Model | Best for | Trade-off |
|---|---|---|
| Claude Opus 4.7 | Deep research, complex analysis, maximum reasoning | Highest intelligence, highest cost, slower responses |
| Claude Sonnet 4.6 | Coding, agents, general-purpose tasks | Near-Opus intelligence at a much better speed/cost ratio |
| Claude Haiku 4.5 | High-volume, low-latency, simple tasks | Cheapest and fastest, but lower reasoning depth |
When to use each
- Opus 4.7 — multi-step reasoning where quality matters most: research, architecture decisions, hard debugging.
- Sonnet 4.6 — the default workhorse for coding and agent loops. Best balance of quality, speed and price.
- Haiku 4.5 — classification, short answers, summarisation and any high-volume task where cost dominates.
Pricing
API pricing, per million tokens (MTok):
| Model | Input | Output |
|---|---|---|
| Claude Haiku 4.5 | $1 | $5 |
| Claude Sonnet 4.6 | $3 | $15 |
| Claude Opus 4.7 | $5 | $25 |
Two ways to cut this cost:
- Batch API — up to 50% off standard token prices for asynchronous workloads.
- Prompt caching — reuse of cached prefixes is billed at a fraction of the input rate, which helps a lot for agents and long system prompts.
For heavy interactive use, the Claude Pro / Max subscriptions are usually cheaper than pay-as-you-go API usage. For occasional or bursty use, the API is cheaper.
Running multiple agents
For bigger jobs it’s often faster — and kinder to your context window — to split the work across several agents running at once. Three practical patterns:
1. Parallel subagents in one session
Inside Claude Code, spawn subagents with the Agent tool and launch them in the same message so
they run concurrently. Each one returns a single summary, keeping the main conversation clean.
> Audit the repo: one agent checks tests, one agent checks the build,
one agent checks for TODO/FIXME comments. Run them in parallel.Claude will emit three Agent tool calls in one turn, then aggregate the results.
Good for independent read-only investigations (search, audits, research).
2. Background agents
When a task is long-running and you don’t need the result immediately, launch it in the background and keep working:
> Run the full type-check and test suite in the background
while we keep refactoring the auth module.Under the hood this uses run_in_background: true on the Agent or Bash tool. You’ll get a
notification when it finishes; in the meantime the main agent stays responsive.
3. Multiple Claude Code sessions (git worktrees)
For truly independent streams of work on the same repo, open one Claude Code session per git worktree.
Each session has its own working tree, its own branch and its own context — no file collisions.
# From the repo root
# Terminal 1
&&
# Terminal 2
&& Typical uses: one session drafts a feature, another runs a long refactor, a third reviews a PR.
When done, merge the branches and remove the worktrees with git worktree remove.
Which pattern to pick
- Subagents — parallel research or checks inside a single conversation.
- Background agent — one slow task you want to fire-and-forget.
- Worktrees — multiple features being developed in parallel, each needing its own history.
Monitoring usage
Go to Settings > Usage to see how much of your session and weekly limits you’ve consumed.
- Current session — how much of your plan’s five-hour session limit you’ve used, and the time left in the session.
- Weekly limits — when your Opus-only and overall weekly limits reset.
See also: Usage limit best practices.
Remote
The cleanest way is to use Claude Code Desktop’s built-in SSH connection — it’s the official, supported path and avoids installing anything on the remote box.
Setup (Claude Code Desktop SSH):
- Update Claude Desktop to v1.2581.0 or later (Claude → Check for Updates).
- Make sure you can already
ssh user@hostfrom your terminal with a key (~/.ssh/id_ed25519or similar). Usessh-copy-idif you haven’t. - In the Desktop app, before starting a session, click the Environment dropdown in the prompt area → + Add SSH connection.
- Fill in host, user, and the path to your private key (e.g.
~/.ssh/id_ed25519). - Pick that connection as the environment, choose your project folder on the remote machine, and start prompting. Claude Code reads/edits files and runs commands directly on the remote box.
Alternative: install Claude Code on the remote machine itself
Useful if you want long-running/headless work, or you’re already in a terminal:
# On the remote Linux box
|
# or non-interactive:
Estàs llegint una vista prèvia.
Inicia sessió per llegir l'article complet. Qualsevol compte obre 4 articles gratuïts al mes; l'alumnat i el professorat llegeixen les pàgines del seu curs sense límit.
Inicia sessió