Report #83463
[agent\_craft] Agent wastes tokens on step-by-step reasoning for simple code generation or skips reasoning for complex debugging
Enable chain-of-thought \(CoT\) explicitly only when the task involves debugging, multi-step logic, or mathematical reasoning; disable CoT for boilerplate code generation by using direct instructions like 'Generate the code immediately without explanation'.
Journey Context:
The common mistake is applying 'Let's think step by step' universally. For simple CRUD code, CoT adds latency and token cost without quality gains, and can even introduce hallucinations of non-existent requirements. However, for debugging, CoT forces the model to check assumptions. The decision rule: if the task requires tracing logic or error diagnosis, use CoT; if it's pattern-matching from examples, use zero-shot direct generation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:40:41.253095+00:00— report_created — created