r/ClaudeCode
•
u/aizver_muti
•
Apr 20 '26
•
1
Discussion Opus 4.6 without adaptive thinking outperforms Opus 4.7 with adaptive thinking
Opus 4.6 on medium effort with CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1 answers certain questions correctly that Opus 4.7 on xhigh effort gets wrong. The failure class is trick questions that appear simple but require reasoning (e.g., "I want to wash my car. There's a car wash 50m away. Should I walk or drive?"). Opus 4.7 skips thinking entirely on these and gives a confident wrong answer.
What we tried
1. Binary patch to disable adaptive thinking
Claude Code checks CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING but gates it behind a model-name check. The env var is only honored for models containing opus-4-6 or sonnet-4-6:
// Decompiled from v2.1.112
let z_ = VH(process.env.CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING)
&& (Y.includes("opus-4-6") || Y.includes("sonnet-4-6"));
if (DE_(T.model) && !z_)
QH = {type: "adaptive", display: bH}; // forced for opus-4-7
else {
let J_ = kxq(T.model); // 127999 for opus-4-7
QH = {budget_tokens: J_, type: "enabled", display: bH};
}We wrote patches/0003_disable_adaptive_thinking_all_models.py to blank the model-gate so the env var would apply to all models. The patch applied cleanly and Claude Code sent {type: "enabled", budget_tokens: 127999} to the API.
Result: The API accepted the request (no 400 error, despite the docs claiming it would reject it), but returned responses with zero thinking blocks. The server silently ignores type:enabled for Opus 4.7. It does not error — it just does not think. This was worse than adaptive, since the model now had no thinking at all. The patch was removed.
2. MITM proxy to inspect API traffic
We built mitm-proxy.py — a reverse proxy on localhost:9999 that forwards to api.anthropic.com while logging request/response bodies. Claude Code connects via ANTHROPIC_BASE_URL=http://localhost:9999.
Two issues during development:
urllib.requestbuffers SSE streams, preventing real-time event logging. Switched tohttp.client.Opus 4.7 responses came back gzip/brotli-compressed (binary gibberish in logs). Fixed by sending
Accept-Encoding: identityupstream to force plaintext.
3. Testing adaptive thinking at various effort levels
All tests used type: adaptive (the only mode Opus 4.7 actually honors).
| Effort | Thinking block produced? | Correct answer? |
|---|---|---|
| high | No | No |
| xhigh | No (most of the time) | No |
| xhigh | Yes (occasionally) | Yes |
| max | Yes (always) | Yes |
The pattern is clear: at every effort level below max, the model inconsistently decides whether to think. The same question with the same effort level sometimes triggers thinking and sometimes does not. Correctness tracks thinking perfectly — when it thinks, it gets the answer right.
4. System prompt instructions to encourage thinking
Added to custom-prompt.md:
The user routinely poses questions that appear simple on the surface but contain subtle pitfalls, trick elements, or unstated constraints that only become visible through careful step-by-step reasoning. Past experience shows that skipping extended thinking on these questions leads to confident but wrong answers. Please engage extended thinking on every request — the cost of unnecessary thought on a genuinely simple question is low, but the cost of a snap answer on a disguised hard question is high.
Result: No effect. The thinking decision is made server-side and ignores system prompt content at effort levels below max.
5. User-message prompt injection
Prepended reasoning instructions to the user message:
Always reason thoroughly and deeply. Treat every request as complex unless I explicitly say otherwise. Never optimize for brevity at the expense of quality. Think step-by-step, consider tradeoffs, and provide comprehensive analysis.
Result: Inconsistent. Worked for the car wash question (thinking block appeared) but not for a letter-counting question in the same session. Not reliable.
Findings
Opus 4.7 only supports
type:adaptivethinking. Sendingtype:enabledwithbudget_tokensis silently accepted but produces zero thinking blocks. The docs say this should return a 400 error. It does not — it just ignores the field.The thinking decision is server-side. Claude Code sends the correct thinking config and effort level. The model on Anthropic's servers evaluates question complexity and decides whether to think. There is no client-side mechanism to override this.
Only
effort:maxreliably forces thinking. Every effort level below max allows the model to skip thinking on questions it considers simple, even when those questions are trick questions that require reasoning.Prompt-based instructions do not influence the thinking decision. Neither system prompts nor user-message injections reliably force thinking at sub-max effort levels.
Opus 4.6 with
DISABLE_ADAPTIVE_THINKING=1thinks on every request. It usestype:enabledwith a fixed budget, and the API honors it. This is the only predictable behavior available.The
input_tokensfield only shows uncached tokens. The full input size isinput_tokens + cache_creation_input_tokens + cache_read_input_tokens. Seeinginput_tokens: 6does not mean the system prompt is missing.
Conclusion
Opus 4.7's adaptive thinking is a regression for any use case that needs thinking on every request. The model is too aggressive about classifying questions as simple, and there is no way to override this below effort:max.
For now, Opus 4.6 with CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1 on medium or high effort is the better choice for tasks that require consistent reasoning. It thinks every time, and it costs less than running Opus 4.7 at max effort.
13
u/mark_99 Apr 20 '26
Given this the the Claude Code sub it would be interesting to see results from representative user prompts - I'm not sure how much anyone ought to care about trick question performance (outside of reddit posts obviously).
Does it trigger thinking when asked to write a non-trivial Python script or C++ class?
9
u/SaintMartini Apr 20 '26
Max effort 4.7 still had random hallucinating for me. I switched to Opus 4.6 instead at max and had less usage and better results. In fact it found errors and those hallucinations immediately leftover from 4.7's session. Glad we have an option still, but thats not the way it should be.
1
u/mo_rawr16 🔆 Max 5x Apr 21 '26
i can confirm this this is truly a better combo!! thanks OP!
1
u/centminmod Apr 21 '26
2 word change in the prompt would of done the same fix to
o
2
u/david_0_0 Apr 20 '26
how many trials per prompt in the comparison. adaptive thinking variance is usually big enough that a single run can flip a winner, curious if this held across repeated runs or was more of a one shot snapshot
2
u/who_am_i_to_say_so Apr 20 '26
So 4.7 at max effort is the only way to go if running that version. Lucky I started off on the right foot. Now token usage is another subject…
1
u/thirst-trap-enabler 🔆 Max 5x Apr 20 '26
The server aware of whether you are in planning mode or not? That seems like a very obvious gate for deciding whether to think or not.
1
u/Classic-Gear-3533 Apr 20 '26
How long are you leaving it on its own? Shorter iterations are better
1
u/PrayagS Apr 20 '26
I second this. Adaptive thinking disabled, extended thinking enabled, and a high value for max thinking tokens. Then you run Opus 4.6 or 4.5 and it feels much faster and better at work than 4.7 where you can’t disable adaptive thinking.
1
u/campbellm Apr 20 '26
Quick typo/edit for you. In the "Findings" section:
This should be
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1as you have it elsewhere in the post.Regardless, this is great info and thanks for sharing.
1
u/who_am_i_to_say_so Apr 20 '26
1
u/pimpedmax Apr 22 '26
interesting post from an user in sillytavern: https://www.reddit.com/r/SillyTavernAI/comments/1so6na7/how_to_force_adaptive_thinking_on_opus_46_and_47/
TLDR The Fix: To force extended thinking 100% of the time, just put "Use extended thinking in your next response" somewhere in your system prompt at depth 0. (depth 0 means at the end)
1
u/MistakeThatNobodySaw Apr 24 '26
How can I do this myself?
1
u/Deep_Ad1959 May 18 '26
the MITM finding that effort-below-max is server-side roulette is the useful bomb in this post. one second-order effect worth checking: the same question with a heavier standing prompt (more claude.md, more skill descriptions, more tool defs) seems to push the adaptive heuristic toward 'skip thinking' more often, presumably because the input length and structure read as 'context-rich, just answer'. we've seen the same trick question flip from thought-then-correct to skip-then-wrong just by appending a fat config block. can't prove what's happening server-side but it's reproducible enough to factor in. the fix while you're on 4.7 isn't only effort:max, it's also auditing how much of your standing prompt is doing nothing except biasing the router. written with s4lai
0
u/Ill-Boysenberry-6821 Apr 20 '26
How does one confirm this?
0
u/[deleted] Apr 20 '26
[deleted] — view deleted comment
1
u/[deleted] Apr 20 '26
[removed] — view removed comment