{"slug": "how-claude-tracks-its-own-reasoning-without-a-token-counter", "title": "How Claude Tracks Its Own Reasoning Without a Token Counter", "summary": "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.", "body_md": "If you’ve used Claude’s API with extended thinking, you’ve written something like this :\n\n```\nthinking={\"type\": \"enabled\", \"budget_tokens\": 16000}\n```\n\nYou 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.\n\nBut I got curious about three questions the docs don’t answer:\n\nThe 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.\n\nThe 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.\n\nThe 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.\n\n**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.\n\nThis 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.\n\nThe 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.\n\n**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.\n\n**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.\n\nTwo ways a thinking block ends:\n\nThe 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.\n\nThis 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.\n\nYou 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.**\n\nEverything 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.\n\nNo 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.\n\nAs 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.\n\nThe practical differences:\n\nThe 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.\n\nA 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.\n\nIf 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.\n\nIf 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.\n\nEither 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.\n\n[How Claude Tracks Its Own Reasoning Without a Token Counter](https://pub.towardsai.net/claude-doesnt-count-its-own-tokens-305a61a311ae) was originally published in [Towards AI](https://pub.towardsai.net) on Medium, where people are continuing the conversation by highlighting and responding to this story.", "url": "https://wpnews.pro/news/how-claude-tracks-its-own-reasoning-without-a-token-counter", "canonical_source": "https://pub.towardsai.net/claude-doesnt-count-its-own-tokens-305a61a311ae?source=rss----98111c9905da---4", "published_at": "2026-07-09 11:30:56+00:00", "updated_at": "2026-07-09 11:47:34.136494+00:00", "lang": "en", "topics": ["large-language-models", "ai-products", "ai-infrastructure"], "entities": ["Anthropic", "Claude"], "alternates": {"html": "https://wpnews.pro/news/how-claude-tracks-its-own-reasoning-without-a-token-counter", "markdown": "https://wpnews.pro/news/how-claude-tracks-its-own-reasoning-without-a-token-counter.md", "text": "https://wpnews.pro/news/how-claude-tracks-its-own-reasoning-without-a-token-counter.txt", "jsonld": "https://wpnews.pro/news/how-claude-tracks-its-own-reasoning-without-a-token-counter.jsonld"}}