Where Claude Hides Its Reasoning (and What I Learned Chasing It)
It started with the most boring prompt imaginable: “write a Python function for the first 10 Fibonacci numbers.” A minute later I was knee-deep in network proxies, encrypted AI thoughts, and a genuinely surprising design decision by Anthropic. Here’s the story, because I think the things I stumbled onto are worth knowing if you use Claude Code or build with the API. All the tools I built along the way are open-source, so you can follow along or reproduce any of it yourself: https://github.com/datafireball/ai-engineering-notes/tree/main/2026-06-01-claude-code-reasoning-redaction
Every chat leaves a diary
The first thing I learned is that Claude Code quietly keeps a complete record of every conversation on your own machine, tucked away in a hidden folder. Each line of that file is one moment in the session: you typing, the model thinking, a tool running, a result coming back. It’s a great window into what’s actually happening behind the scenes, so I built a little viewer to read it in plain English (it’s the chatlog-viewer.html in the repo above).
That’s when I noticed something odd. The model’s “thinking” — its private reasoning before it answers — was in the file, but the actual words were blank. All that remained was a long signature, a kind of tamper-proof wax seal that proves the model really did think, without revealing what it thought. So the diary keeps a receipt of the reasoning, not the reasoning itself. Naturally, I wanted to know where the words went.
Chasing the missing thoughts
My first theory was simple: the reasoning must travel across the network, and Claude Code probably just throws it away after it arrives. So if I could watch the network traffic, I’d catch it in transit. I set up a small local proxy to record everything flowing between Claude Code and Anthropic’s servers, and ran a hard problem to make the model really chew on it. (That proxy, capture_api_proxy.py, is in the repo too, along with a one-command launcher.)
I was wrong. The reasoning never showed up, even on the wire. Digging into the request, I found the answer hiding in plain sight: Claude Code sends a flag literally named “redact-thinking.” That tells Anthropic’s servers to strip the reasoning text before it ever leaves their building. The model definitely reasoned — it was billed for hundreds of thinking tokens — but not a single word of it crossed the network. The redaction isn’t happening on my laptop; it’s a deliberate decision on Anthropic’s side, just for their own apps.
The only door left: the raw API
There’s one channel that doesn’t send that redact flag — calling the Anthropic API directly with your own key. So I loaded a few dollars of credit and tried it. And here’s where it got really interesting.
When I asked the flagship model, Opus 4.8, the thinking came back empty again — just the signature, no words. But when I switched to Sonnet, the full reasoning poured out, word for word: the model recognizing the number as 2 to the 53rd power plus one, spotting a factoring shortcut, double-checking with a digit-sum trick. Same question, same setup, completely different visibility. The difference was the model.
So I tested every model I could reach. The pattern was clean: only the two newest, most powerful models — Opus 4.7 and Opus 4.8 — keep their reasoning encrypted. Every other model, including older Opus versions, hands it right over. It isn’t about which tier you pick; it’s about being the newest and smartest model in the lineup.
So why hide it?
That specific pattern is the tell. If this were about safety or polish, it would apply to every model. Instead, it lands exactly on the current frontier models, which points to a simpler motive: protecting the crown jewels. A model’s raw chain-of-thought is incredibly valuable training material. A competitor could collect those traces and use them to cheaply train a rival that imitates the best model’s problem-solving. Encrypting the reasoning of the newest flagship slams that door shut, while leaving the smaller and older models — less of a prize — open. It’s the same move OpenAI made by hiding its o-series reasoning.
There’s a nice side detail too: even when the reasoning is encrypted, that signature still does real work. You can hand it back to the model in a later turn and it can pick up its own train of thought, while the server checks that nothing was tampered with. The reasoning is preserved and usable — just not readable by us.
What I took away from all this
A few things stuck with me. Your local AI logs are a richer black box than you’d expect, but the model’s private reasoning is deliberately not in them. The redaction that hides it happens on the server, not in the app. And even paying for raw API access doesn’t guarantee you’ll see the reasoning — on the newest flagship models, it’s locked. If you want to actually read a model think out loud, reach for a model that still shows its work.
One last, slightly embarrassing lesson worth repeating: never paste an API key into a chat or a terminal that gets logged. I did, briefly, for this experiment — and promptly found it sitting in plain text inside my own capture logs. Treat any key that touches a transcript as burned, and rotate it.
A quick honesty note: everything I described about the behavior — which models hide their reasoning, where it gets stripped — I measured directly. The “why” is my best read of the evidence and Anthropic’s public reasoning, not something pulled from an internal document. But the boundary lines up almost too neatly to be a coincidence.
The code
Every tool from this investigation is open-source here: https://github.com/datafireball/ai-engineering-notes/tree/main/2026-06-01-claude-code-reasoning-redaction — including the JSONL log viewer, the API capture proxy and its launcher, the direct-API reasoning capture script, and HTML report generators. The repo’s home page is at https://github.com/datafireball/ai-engineering-notes if you want to poke around the rest. Captured logs are deliberately left out, since they can contain prompts, file paths, and secrets.


