DEV Community

TerminalBlog
TerminalBlog

Posted on • Originally published at terminalblog.com

Claude Code Now Runs Code Reviews in the Background and Gets Opus 5

Originally published at terminalblog.com

Claude Code now runs /code-review as a background subagent so your main conversation stays clear, and the newest Opus model — Claude Opus 5 with a 1-million-token context window — is available as a first-class pick in the model selector. These two changes arrived across Claude Code v2.1.218 (July 22) and v2.1.219 (July 24), and they fix two of the most common complaints people have with long coding sessions: a cluttered conversation and a context limit that runs out mid-task.

If you have ever asked Claude Code to review a pull request and then watched your entire conversation fill up with diff comments while you were still trying to work, the background review change is the one that matters most day to day. If you work on large codebases where 200,000 tokens of context is not enough, the Opus 5 addition is the headline.

What changed in v2.1.218: code review runs in the background

Before this update, running /code-review in Claude Code would execute the review inline — every file read, every diff comment, every summary paragraph would appear directly in your conversation. On a large pull request, that could mean hundreds of tokens of review output stacked on top of your working context. If you were in the middle of a multi-step task, the review output would push your earlier messages out of the context window, and you would lose track of where you left off.

The fix is straightforward: /code-review now spawns a background subagent. The subagent reads the diff, performs the review, and writes its findings to a separate output — your main conversation stays untouched. You get the review results when they are ready, but your working context, your current task, and your conversation history remain intact.

For beginners, this works like delegating a task to a colleague. You say "review this code," the agent goes and does it while you keep working on something else, and when the review is done you see the results without your own workspace getting cluttered. The technical mechanism is a subagent — a separate instance of Claude that runs independently with its own context window, so the review's token usage does not compete with yours.

This also means stacked slash commands continue to work as expected. If you run /code-review /review-security, both commands target the review output, not your main conversation. Before this change, the review output could interfere with stacked command routing because everything shared the same context.

What changed in v2.1.219: Claude Opus 5 joins the model picker

Claude Code v2.1.219 adds claude-opus-5 as a selectable model. This is Anthropic's latest Opus-tier model, and the key numbers are:

  • 1-million-token context window — more than four times the previous Opus limit. For codebases with tens of thousands of files, this means the agent can hold your entire project structure in context without compressing or summarizing.
  • Fast mode at $10/$50 per million tokens (input/output) — the same pricing tier as the previous Opus model, so switching does not increase your per-token cost.
  • Default Opus model — when you select "Opus" in the model picker, you now get Opus 5. The old model row has been renamed to show its context limit so you can tell them apart.

The model picker now shows "Opus (1M context)" for the new model, fixing a display issue where the merged row just said "Opus" and users could not tell which model they were getting. This matters because Opus 5 and the previous Opus have different strengths — Opus 5's larger context makes it better for multi-file refactors and full-project analysis, while the older model may still be preferable for narrow, high-precision tasks where the extra context is not needed.

How to select Opus 5

If you are using Claude Code in the terminal, run /model and select claude-opus-5 from the list. If you prefer a one-turn override, use /model --once claude-opus-5 — this switches to Opus 5 for the next message only and then reverts to your default model. This is useful when you need the large context for a single analysis task but want to stay on a cheaper model for everyday coding.

In the SDK or headless mode, pass the model identifier directly in your configuration. The model string is claude-opus-5.

Other notable changes in v2.1.219

The Opus 5 addition gets the headlines, but v2.1.219 includes several smaller features that affect day-to-day use:

Sandbox network strict allowlist. A new setting, sandbox.network.strictAllowlist, lets you lock down which network hosts a sandboxed Claude Code session can reach. When enabled, any connection to a host not on the allowlist is denied without prompting. This is useful for teams that want to ensure agents only talk to approved APIs and package registries.

DirectoryAdded hook. When you run /add-dir mid-session or call register_repo_root from the SDK, a new DirectoryAdded hook fires. This lets you write custom logic that triggers whenever a new working directory is registered — for example, automatically scanning the new directory for configuration files or updating a project manifest.

MCP server error reporting. The mcp_server_errors field now appears in the headless stream-json init event, listing any MCP config entries that were skipped during validation. In terminal mode, a startup warning is printed. This makes it much easier to diagnose why an MCP server is not loading instead of silently missing tools.

Nested subagent forwarding. When --forward-subagent-text is set, subagents spawned at depth 2 or deeper now appear in the stream-json output, keyed by their spawning agent's tool-use ID. This is relevant if you are building tooling on top of Claude Code's output streams and need visibility into nested agent calls.

Other notable changes in v2.1.218

The background code review is the main feature, but v2.1.218 also shipped:

Screen-reader mode improvements. The screen reader now echoes only the typed character instead of rewriting the entire input line on every keystroke. This fixes a real accessibility issue where screen readers would announce the full prompt content on each keypress, making the tool unusable for developers who rely on assistive technology.

Dynamic workflow size default. Dynamic workflows now default to a "medium" size guideline, targeting fewer than 15 agents. You can adjust this through /config or the workflowSizeGuideline setting. This prevents runaway agent spawning on large tasks where the default "unrestricted" mode could create dozens of parallel agents and exhaust your API budget.

Vim mode fix. Pressing the left arrow on an empty prompt now returns from NORMAL mode to the agent view, matching expected Vim behavior. Previously, you had to switch to INSERT mode first, which was a small but annoying friction point for Vim users.

Why these changes matter for beginners

If you are new to coding agents, two things stand out from this release cycle.

First, the background code review pattern is worth understanding because it applies beyond Claude Code. Any coding agent that performs long-running tasks — full-project analysis, test generation, security audits — benefits from running those tasks in subagents that do not pollute the main conversation. When you evaluate tools, look for this pattern: can long tasks run in the background while you keep working?

Second, the 1-million-token context window on Opus 5 changes what is possible. Before this, coding agents hit context limits on large projects and had to rely on compression, summarization, or smart file selection to fit relevant code into the window. With 1 million tokens, the agent can hold most mid-sized codebases in context at once, which means fewer mistakes from missing context and less time spent re-explaining the project structure.

The tradeoff is cost. At $10 per million input tokens, a full 1-million-token context window costs $10 per request. For a typical coding session that uses 200,000 input tokens, you pay $2 — the same as before. But if you are loading an entire project into context, the cost scales with the project size. For most individual developers, this stays well under $5 per session. For teams running automated workflows, the cost math changes.

How to update

If you have Claude Code installed via npm, run:

npm install -g @anthropic-ai/claude-code@latest
Enter fullscreen mode Exit fullscreen mode

For other installation methods, check the Claude Code documentation for platform-specific instructions.

After updating, run claude --version to confirm you are on v2.1.219 or later. Then run /model to see claude-opus-5 in the model list.

What this means for the Claude Code roadmap

These two releases show a clear direction: Claude Code is moving toward treating the terminal session as a persistent workspace rather than a one-shot chat. Background subagents, directory hooks, and a 1-million-token context window all point toward longer, more complex workflows where the agent maintains state across many turns without losing context.

The next area to watch is how the background subagent pattern extends to other long-running tasks. Code review was the first use case, but test generation, security scanning, and documentation writing are all candidates for background execution. If Claude Code applies this pattern broadly, it changes the economics of agent-assisted development — you stop paying the "context tax" of long-running tasks and can instead work on multiple things at once.

Top comments (0)