Repository navigation
[FEATURE] Plan Mode Hallucination Prevention #20051
Description
Preflight Checklist
- I have searched existing requests and this feature hasn't been requested yet
- This is a single feature request (not multiple features)
Problem Statement
I have noticed Claude Code Plan Mode consistently creates plans that will cause Claude Code to hallucinate during implementation. The implementation hallucinations occur with some predictability with them occuring 100% of the time after a mid-task context compaction. I have isolated the genesis of the problem to the plans that Claude Code generates. They are not detailed and follow a waterfall implementation pattern. This means that validation of previous steps 100% of the time occurs after a mid-task context compaction and loss of contextual detail. Combined with the over-confidence of the LLM models, will 100% of the time say the implementation was 100% successful even though Claude Code 100% of the time does not even know what it was to validate nor how to properly validate what was implemented.
Proposed Solution
I'd like the Plan Mode agents to generate a detailed plans that do not use Phases, but rather have Steps that use the I.N.V.E.S.T. criteria. Each Step should have a validation and congruence criteria and actions performed prior to moving to the next step. Then there the context should be cleared before starting the next step, and the plan re-read by Claude Code.
Alternative Solutions
I've tried different variations of this approach. The current work-around is to force Claude Code to implement the Proposed Solution by having a set critique that I copy-paste into the approval step. In my plan prompt I add this phrase: "Present your plan for review and approval before continuing to implementation. REMEMBER NO ASSUMPTIONS. Seek guidance using the AskUserQuestions tool." then in the review step, I add the guidance in the solution above AGAIN as a new prompt. "NO. YOUR PLAN IS NOT APPROVED AND WILL CAUSE YOU TO HALLUCINATE DURING IMPLEMENTATION. Update your plan so that..."
Priority
High - Significant impact on productivity
Feature Category
Other
Use Case Example
Example scenario:
- Given I have to add a new data field to a React frontend that requires an update to the business logic of the model, controller, and data structure in a database
- When I enter PLAN MODE and work using the AskUserQuestions to build the plan
- Then Claude Code would generate a plan that does not have phases, is a series of steps with acceptance criteria, validation behavior in every step, congruence behavior in every step, and clears the context between every step.
Additional Context
This approach to plan design has shown to work 90+% of the time.
Activity
devinhedge commentedon Jan 22, 2026
As I dig through code, I wonder if implementation of this FEATURE would require the addition of a Pre and Post Compaction Hook?
github-actions commentedon Jan 22, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
devinhedge commentedon Jan 24, 2026
It is the FEATURE request response to #19736
Which has a better description?
github-actions commentedon Feb 27, 2026
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
github-actions commentedon Mar 7, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.