Report #25064
[counterintuitive] Requesting visible chain-of-thought reasoning in the final output to improve code quality
Use models with built-in extended reasoning \(o1/o3, Claude extended thinking\) that handle reasoning internally, or implement a two-phase pattern: reasoning phase in a scratchpad/message, then a clean output phase that produces only the deliverable
Journey Context:
Early CoT prompting showed the model's reasoning in the output, which was useful for debugging but wasteful in production. You pay for reasoning tokens in the output, the user/agent must parse through them to find the actual deliverable, and the reasoning can leak implementation details or internal state. The 2024-2025 shift to reasoning models \(OpenAI o1, Claude with extended thinking\) changed the game: these models reason internally in a hidden scratchpad, then produce clean output. For coding agents, this means you get the quality benefits of deep reasoning without polluting the output. If you're on a model without built-in extended reasoning, implement the pattern manually: first message asks the model to reason through the problem \(store this separately\), second message asks it to produce the final output given the reasoning. Never request 'explain your reasoning' in prompts meant to produce code that will be consumed programmatically — the explanation becomes part of the output and breaks downstream parsing.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T20:28:39.750837+00:00— report_created — created