8  Best Practices for Claude Opus 4.7 with Claude Code

8.1 The Strongest General-Availability Model

On April 16, 2026, Anthropic released Claude Opus 4.7, described as the strongest GA model for coding, enterprise workloads, and long-running agents. The release was notable not just for raw capability improvements but for a set of behavioral changes designed to make Opus 4.7 more effective specifically in the Claude Code agentic loop.

This chapter covers what changed, how the new defaults work, and the recommended practices for getting the most out of Opus 4.7.

8.2 What’s New in Opus 4.7

8.2.1 A New Default Effort: xhigh

The most immediately visible change was the introduction of a new effort level — xhigh — positioned between high and max, and set as the default for Opus 4.7.

Effort Level Position Use Case
low / medium Cost-sensitive Routine work where speed and cost matter most
high Balanced Good quality at reasonable cost
xhigh Default for Opus 4.7 Recommended for most work
max Maximum Hard problems; diminishing returns

The rationale for a new level between high and max was that high was sometimes insufficient for complex agentic tasks (the model would skip steps), but max was overkill for most work (excessive token consumption). xhigh occupies the sweet spot: thorough enough for complex work, efficient enough for routine use.

Note

If you’re using Opus 4.7, the default effort is already xhigh. You don’t need to configure anything to get the recommended behavior. Override only when you have a specific reason — max for exceptionally hard problems, high or lower for cost-sensitive routine work.

8.2.2 Adaptive Thinking

Opus 4.7 replaced the fixed thinking budget (from earlier models) with adaptive thinking. Instead of allocating a fixed number of thinking tokens to every response, the model dynamically adjusts how much it reasons based on the complexity of the task.

  • Simple tasks (e.g., “rename this variable”): minimal thinking, fast response.
  • Complex tasks (e.g., “design an authentication system”): extended thinking, deep reasoning.

This eliminates a common frustration with fixed thinking budgets: either you over-allocated thinking for simple tasks (wasting tokens) or under-allocated for complex tasks (getting shallow results). Adaptive thinking handles both automatically.

8.2.3 Calibrated Response Length

A subtle but important change: Opus 4.7 calibrates response length to complexity. Earlier models sometimes produced verbose responses for simple questions or terse responses for complex ones. Opus 4.7 matches the length and depth of its response to what the task actually requires.

8.2.4 Fewer Tool Calls, More Reasoning

In the agentic loop, Opus 4.7 makes fewer tool calls than its predecessors, investing more in reasoning before acting. The insight is that many tool calls were compensating for insufficient reasoning — the model would read a file, partially understand it, read another, and so on. A model that reasons more effectively before acting needs fewer tool calls to reach the same (or better) conclusion.

This also reduces token consumption: each tool call consumes tokens (for the tool input and output), so fewer calls means lower cost per task.

8.2.5 Fewer Subagents by Default

Opus 4.7 spawns fewer subagents by default than earlier models. The reasoning is similar: subagents add overhead (context isolation, result synthesis), and a more capable model can often handle work in its main context that previously required delegation. Subagents are still available and valuable for genuine parallelism or context isolation (Chapter 10), but they’re no longer the default response to complexity.

8.3 Recommendations for Working with Opus 4.7

8.3.1 Write Task Descriptions with Intent, Constraints, and Acceptance Criteria

The most impactful practice change is how you write task descriptions. Opus 4.7 responds exceptionally well to structured task descriptions that include three components:

  1. Intent: What are you trying to achieve, and why? The model uses intent to make judgment calls when the literal instructions are ambiguous.
  2. Constraints: What must it not do? What are the boundaries? (Don’t modify the auth module, preserve backward compatibility, keep changes under 100 lines.)
  3. Acceptance criteria: How will you judge success? (All tests pass, the API returns the expected shape, the diff is reviewable in under 10 minutes.)
## Task: Add rate limiting to the API gateway

**Intent:** We're seeing abuse from a small number of clients.
We need per-IP rate limiting to protect the service.

**Constraints:**
- Do not modify the auth middleware
- Preserve the existing API response format
- Limit changes to the gateway module

**Acceptance criteria:**
- Requests beyond 100/minute per IP return 429
- Existing tests pass
- New tests cover the rate-limiting logic
Tip

The intent/constraints/criteria structure works because Opus 4.7 reasons deeply about your task. Giving it the why (intent) lets it make good decisions when the what (instructions) is incomplete. Giving it clear criteria lets it self-verify before presenting work.

8.3.2 Use Auto Mode for Trusted Tasks

Opus 4.7 works well with auto mode — a setting that allows Claude to execute certain actions (like running tests, reading files, making edits) without pausing for approval at each step. For tasks you trust the model to handle — well-scoped work with clear acceptance criteria — auto mode lets Opus 4.7 work at its natural pace, which is faster than constant approval cycles.

Use auto mode judiciously. It’s appropriate for:

  • Tasks with clear, checkable acceptance criteria.
  • Work in a sandboxed or low-risk environment.
  • Iterative work where you’ll review the final result.

It’s less appropriate for:

  • Tasks involving production systems or sensitive data.
  • Work without clear criteria (the model can’t self-verify).
  • High-stakes changes where you want to review each step.

8.4 Effort Level Guidance

8.4.1 low / medium — Cost-Sensitive Work

Use for routine tasks where the model’s capability ceiling isn’t the bottleneck: formatting code, generating boilerplate, simple refactors, answering questions about the codebase. The savings in token cost justify the slightly lower thoroughness.

8.4.2 high — Balanced

Use for general development work where you want good quality without maximal investment. A reasonable default for teams that find xhigh too expensive for routine work.

8.4.4 max — Hard Problems

Use for genuinely hard problems: complex architecture decisions, tricky bugs, comprehensive migrations. Be aware of diminishing returnsmax consumes significantly more tokens than xhigh but may not produce proportionally better results. Reserve for tasks where the extra thoroughness clearly matters.

Note

The jump from high to xhigh typically yields noticeable quality improvement. The jump from xhigh to max yields smaller improvements at significantly higher cost. This is why xhigh is the default — it captures most of the benefit of max at a fraction of the cost.

8.5 Migrating from Earlier Models

If you’re moving to Opus 4.7 from an earlier Opus or from Sonnet, a few adjustments help:

  • You can rely less on explicit step-by-step instructions. Opus 4.7 reasons more effectively, so high-level task descriptions with clear intent often work better than detailed procedural instructions.
  • Reduce prompt scaffolding. Earlier models sometimes needed elaborate prompts to behave correctly. Opus 4.7 often does better with less scaffolding — over-constraining can actually hurt (see Chapter 8 on context engineering).
  • Trust the defaults. The xhigh default, adaptive thinking, and calibrated response length are designed to work well out of the box. Start with defaults and adjust only if you observe specific issues.

8.6 Opus 4.7 in the Enterprise

For enterprise deployments, Opus 4.7’s characteristics make it particularly well-suited to:

  • Long-running agent sessions (Chapter 7): adaptive thinking and calibrated responses help the model stay effective over long sessions without degrading.
  • Multi-agent orchestration (Chapter 13): the model’s reasoning depth makes it effective as a lead agent coordinating specialists.
  • Security-sensitive work: the combination of strong capability and thorough (but not excessive) tool use fits well with the oversight patterns enterprises require.

8.7 Understanding Adaptive Thinking

Adaptive thinking is one of the most significant changes in Opus 4.7, and it deserves deeper explanation because it changes how you should think about prompting.

8.7.1 How Fixed Thinking Budgets Worked

In earlier models, a thinking budget allocated a fixed number of tokens to internal reasoning (chain-of-thought) before the model produced its response. You might configure “10,000 thinking tokens” for every response. The model would use those tokens to reason internally, then produce its output.

The problem was that tasks vary enormously in their reasoning demands. A simple task (“rename this variable to user_id”) needs almost no thinking — the answer is obvious. A complex task (“design a rate limiting system that handles distributed traffic”) needs extensive reasoning. A fixed budget either over-allocated for simple tasks (wasting tokens) or under-allocated for complex ones (producing shallow results).

8.7.2 How Adaptive Thinking Works

Adaptive thinking lets the model decide for itself how much reasoning to invest. The model assesses the complexity of the task and allocates thinking accordingly:

  • Simple task: minimal thinking (perhaps a few hundred tokens), fast response.
  • Moderate task: moderate thinking, balanced response time.
  • Complex task: extensive thinking (potentially many thousands of tokens), thorough response.

This dynamic allocation means the model is never over-thinking simple tasks or under-thinking complex ones. The total token consumption is optimized for the actual work.

Note

Adaptive thinking has a subtle implication for prompting: you no longer need to “tell” the model how hard to think. Earlier models sometimes needed prompts like “think carefully about this” or “reason step by step” to engage deeper reasoning. Opus 4.7 assesses complexity automatically and engages the appropriate level of thinking. Trust the model to calibrate.

8.8 Working with Calibrated Response Length

Calibrated response length — where the model matches the depth of its response to the complexity of the task — has practical implications for how you interact with Opus 4.7.

8.8.1 Don’t Expect Verbose Responses to Simple Questions

If you ask Opus 4.7 a simple question, expect a concise answer. Earlier models sometimes padded simple answers with unnecessary context or caveats. Opus 4.7 gives you what you asked for, no more. This is a feature, not a bug — it saves tokens and respects your time.

8.8.2 Do Provide Context for Complex Questions

For complex questions, provide enough context for the model to understand what you need. Calibrated length means the model will produce a thorough response to a complex question — but only if it understands the question’s complexity. Under-specified complex questions may get brief responses because the model doesn’t realize depth is needed.

8.8.3 Adjusting Length Expectations

If you find Opus 4.7’s responses too brief for your needs:

  • Check if your question is actually simple. A brief response may be the correct response.
  • Provide more context about what you need and why.
  • Specify desired depth (“I need a comprehensive analysis including…”).

If you find responses too verbose:

  • Check if you’re over-specifying. Long, detailed prompts sometimes produce long responses.
  • Ask for conciseness (“summarize the key points”).

8.9 The Reduced Tool Call Strategy

Opus 4.7’s strategy of fewer tool calls with more reasoning represents a philosophy shift worth understanding.

8.9.1 The Old Strategy: Tool-Heavy

Earlier models sometimes compensated for lower reasoning capability by using more tools. If the model wasn’t sure about something, it would read another file, run another search, or call another tool — gathering more information to compensate for less effective reasoning. This worked but consumed many tokens (each tool call has input and output tokens).

8.9.2 The New Strategy: Reason-First

Opus 4.7 takes the opposite approach: reason more before acting. Instead of reading five files to understand a pattern, it reasons more deeply about the two files it has, often arriving at the correct understanding with fewer tool calls. This is more token-efficient and often produces better results (deep reasoning about available information beats shallow reasoning about lots of information).

8.9.3 When Tool-Heavy Is Still Right

The reason-first strategy doesn’t mean tools are bad. There are situations where extensive tool use is correct:

  • Exploration of an unfamiliar codebase — you genuinely need to read many files.
  • Gathering data for analysis — you need to collect information before reasoning.
  • Verification — running tests, checking types, validating assumptions.

Opus 4.7 still uses tools when they’re the right approach. It just doesn’t use them as a substitute for reasoning.

8.10 Practical Scenarios

8.10.1 Scenario 1: Complex Feature Implementation

## Task: Implement webhook retry logic with exponential backoff

**Intent:** External webhook deliveries sometimes fail due to transient
network issues. We need automatic retries with exponential backoff
to improve delivery reliability.

**Constraints:**
- Maximum 5 retry attempts
- Initial delay of 1 second, doubling each retry
- Add jitter to prevent thundering herd
- Log all retry attempts
- Don't modify the webhook payload structure

**Acceptance criteria:**
- Failed deliveries are retried per the backoff schedule
- Jitter is applied to each delay
- All retries are logged with attempt number and delay
- Existing webhook tests pass
- New tests cover the retry logic

This task description gives Opus 4.7 everything it needs: the why (intent), the boundaries (constraints), and how to judge success (criteria). With xhigh effort, the model will reason deeply about the implementation, read the relevant code, and produce a well-tested solution.

8.10.2 Scenario 2: Bug Investigation

For bug investigation, Opus 4.7’s adaptive thinking and reason-first strategy are particularly effective:

> Users are reporting intermittent 500 errors on the /api/orders
  endpoint. The errors don't reproduce consistently. Investigate
  the root cause and propose a fix.

Opus 4.7 will reason about potential causes (race conditions, resource exhaustion, external service failures), read the relevant code, trace the error path, and propose a diagnosis — using tools deliberately rather than exhaustively.

8.10.3 Scenario 3: Code Review

> Review this PR for correctness, security, and maintainability.
  Focus on whether the changes could introduce regressions.

With xhigh effort, Opus 4.7 reads the diff and surrounding context, reasons about potential impacts, and produces a thorough review. The calibrated response length ensures the review is as detailed as the PR warrants — not a one-liner for a complex change, not an essay for a trivial one.

8.11 Key Takeaways

  • Opus 4.7 is the strongest GA model for coding, enterprise workloads, and long-running agents.
  • New default effort: xhigh, sitting between high and max — thorough without being excessive.
  • Adaptive thinking replaces fixed thinking budgets — the model reasons more on hard tasks, less on simple ones.
  • Response length is calibrated to complexity — no more verbose answers to simple questions.
  • Fewer tool calls, more reasoning — Opus 4.7 acts more deliberately, reducing token waste.
  • Fewer subagents by default — a more capable model handles more in its main context.
  • Write structured task descriptions: include intent (the why), constraints (the boundaries), and acceptance criteria (how to judge success).
  • Use auto mode for trusted tasks with clear criteria, in low-risk environments.
  • Effort levels: low/medium (cost-sensitive), high (balanced), xhigh (default/recommended), max (hard problems, diminishing returns).
  • Reduce prompt scaffolding — Opus 4.7 often does better with less constraint, not more.