Report #60697
[agent\_craft] Model wastes tokens on step-by-step reasoning for simple code transformations like format conversion or regex
Disable chain-of-thought \(CoT\) for deterministic syntax tasks; use direct code generation with strict output format constraints \(e.g., 'Output only the code, no explanation'\)
Journey Context:
Chain-of-Thought is beneficial for algorithmic reasoning \(designing a cache eviction strategy\) but actively harmful for pattern-matching syntax tasks \(converting JSON to CSV, writing regex\). Forcing the model to 'think step by step' on deterministic transformations: \(1\) wastes 20-50% of output tokens on verbose explanations of obvious syntax, \(2\) can introduce reasoning errors where the final code is correct but the explanation hallucinates a constraint, causing the user to mistrust the code, \(3\) increases latency. The heuristic: if the task is 'transpile,' 'refactor,' or 'format' with clear input/output pairs, use zero-shot with output format constraints \(e.g., markdown code blocks only\). Reserve CoT for 'design,' 'debug,' or 'optimize' tasks where the solution path is non-obvious.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:21:54.159937+00:00— report_created — created