[FEATURE] Plan Mode Hallucination Prevention
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] 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.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗