cd /news/large-language-models/how-claude-tracks-its-own-reasoning-… · home topics large-language-models article
[ARTICLE · art-52469] src=pub.towardsai.net ↗ pub= topic=large-language-models verified=true sentiment=· neutral

How Claude Tracks Its Own Reasoning Without a Token Counter

Anthropic's Claude API uses a two-layer system to enforce thinking budgets: a soft layer where the model learns to estimate its own token usage, and a hard layer in the inference engine that forcibly cuts off reasoning when the budget is exceeded. The thinking budget controls how much space the model has to reason before answering, but does not change the model's weights or architecture. Larger budgets allow the model to catch mistakes but do not make it smarter beyond a point.

read6 min views1 publishedJul 9, 2026

If you’ve used Claude’s API with extended thinking, you’ve written something like this :

thinking={"type": "enabled", "budget_tokens": 16000}

You picked 16000 because a blog post said so, or because it felt like a reasonable middle ground. Then you moved on. Fair enough — most of the time you don’t need to know more than that.

But I got curious about three questions the docs don’t answer:

The answers were more interesting than I expected — and they turned out to be a moving target. Anthropic changed the whole mechanism in the last few months. This post covers both: how it actually worked, and what’s replacing it.

The first thing worth clearing up: raising or lowering the thinking budget does not change the model. Same weights, same architecture, same system prompt, same temperature. The only thing that changes is how much room the model has to reason before it commits to an answer.

The classic “bat and ball cost $1.10 combined, the bat costs $1 more than the ball” puzzle illustrates this perfectly. Most people’s gut answer is $0.10 for the ball — wrong. With a small thinking budget, Claude behaves like that gut reaction: it pattern-matches to a plausible-looking answer without the runway to double-check itself. With a larger budget, it has room to set up the algebra, solve it, and catch the discrepancy before answering. Same model, same knowledge — just more space to work through the trap instead of falling into it.

A bigger budget gives the model more room to catch its own mistakes before they reach you. It does not make the model smarter in any absolute sense, and past a point you’re paying for reasoning the model doesn’t need.

This is the part that surprised me — and I should flag up front that what follows is informed inference, not confirmed internals. Anthropic hasn’t publicly documented the enforcement mechanism at this level of detail. But it’s consistent with how transformers work in general and with observable behavior from the outside.

The model does not have a running counter it can query — no internal variable ticking upward as it thinks. Enforcement happens on two separate layers that work together.

The soft layer lives inside the model itself. Claude has been trained on enough examples of “conclude your reasoning within roughly this much space” that it develops a rough, calibrated sense of scale — a short paragraph is a few hundred tokens, a long chain of reasoning is a few thousand. When it senses it’s running long relative to the budget it was given, it starts wrapping up. This is a learned instinct, not a measurement.

The hard layer lives outside the model, in the inference engine. A real token counter runs alongside generation, completely independent of whatever the model “thinks” is happening. The moment that counter hits budget_tokens, the engine forcibly closes the thinking block — regardless of whether the model was mid-sentence — and the model has to produce its final answer from wherever it got cut off.

Two ways a thinking block ends:

The important asymmetry: the model is budget-aware but not budget-precise. Its internal sense of “how much have I used” is an estimate. The engine’s counter is the actual guarantee. If you need a hard ceiling on cost, the hard layer gives it to you — not the model’s self-regulation.

This section is my best mechanistic explanation, not an Anthropic white paper. The reasoning is consistent with transformer architecture and observable behavior, but treat it as a mental model rather than ground truth.

You might expect some kind of introspection mechanism — the model “checking in” on itself. The most plausible answer is simpler: the model reads its own thinking text the same way it reads anything else.

Everything Claude has written inside the current thinking block sits in the context window, just like your prompt or a document you uploaded. Transformer attention doesn’t distinguish “text I wrote a moment ago” from “text the user gave me” — it’s all tokens the model can attend back to. When the model decides whether to keep reasoning or start concluding, it’s not consulting a counter; it’s re-reading what it’s already said and forming a rough judgment about how much ground it’s covered. The same way you’d glance back at a page of notes and gauge whether you’ve been at this for two minutes or twenty.

No special mechanism. No hidden counter accessible to the model. Just attention over its own prior output, plus the trained instinct for scale. The hard token counter in the inference engine remains the only precise source of truth, sitting completely outside this process.

As of the last few months, Anthropic has been moving away from manual budget_tokens entirely, in favor of adaptive thinking combined with an effort parameter.

The practical differences:

The underlying mechanism I described above — soft self-regulation plus hard engine-level enforcement — still governs how the model manages a reasoning budget. What changed is who sets that budget and how directly. With budget_tokens, you set the hard ceiling yourself, token by token. With adaptive thinking, you hand that decision to the model and tune how liberally it should reason via effort — the hard enforcement still exists underneath, it's just no longer a number you pick.

A separate feature worth knowing about if you’re building agents: task budgets, currently in beta on a handful of models. Rather than budgeting a single thinking block, this gives Claude an advisory token ceiling for an entire multi-step agentic loop — tool calls, tool results, thinking, and output combined — and the model gets a running countdown injected into its context so it can pace itself and wrap up gracefully rather than getting cut off mid-task. Same underlying philosophy — give the model a sense of its remaining runway — applied to a much longer horizon than a single thinking block.

If you’re building on newer models (Opus 4.6 and later, Sonnet 4.6 and later), stop reaching for budget_tokens as your default. Set effort instead, and let adaptive thinking decide when reasoning is warranted — it tends to outperform a fixed budget on workloads that mix trivial and complex requests, precisely because it doesn't spend thinking tokens on the easy ones.

If you’re still on Sonnet 4.5 or Opus 4.5, or you have a genuine need for a hard, predictable ceiling on thinking cost, budget_tokens still functions the way it always did — soft self-regulation, hard engine enforcement, no true internal counter. You're now the one holding the exception, not the default path.

Either way, the core insight holds: the model doesn’t “know” its budget the way your code knows a loop counter. It reads its own output and pattern-matches against training, backstopped by an external process doing the actual counting. Understanding that distinction is the difference between debugging thinking-budget issues by reasoning and debugging them by guesswork.

How Claude Tracks Its Own Reasoning Without a Token Counter was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.

── more in #large-language-models 4 stories · sorted by recency
── more on @anthropic 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-claude-tracks-it…] indexed:0 read:6min 2026-07-09 ·