Report #76687
[agent\_craft] Chain-of-Thought reasoning increases hallucinations for syntax errors but helps for logic bugs
Use conditional prompting: for syntax errors \(lint failures, parse errors\), prompt for immediate fix without CoT; for test failures or logic bugs, prepend 'Let's think step by step to trace the execution'.
Journey Context:
Standard advice is 'always use CoT for hard problems'. But for coding, syntax errors are pattern-matching tasks where explicit reasoning gives the LLM room to hallucinate non-existent syntax rules. Logic bugs benefit from execution tracing. The conditional approach requires an error classifier \(syntax vs semantic\) which can be a lightweight regex or separate LLM call.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T11:18:51.226363+00:00— report_created — created