Skip to content

[FEATURE] Plan Mode Hallucination Prevention #20051

Closed as not planned
Closed as not planned

Description

@devinhedge

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

  1. devinhedge commented on Jan 22, 2026

    @devinhedge
    Author

    As I dig through code, I wonder if implementation of this FEATURE would require the addition of a Pre and Post Compaction Hook?

  2. github-actions commented on Jan 22, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. [BUG] Claude forgets about plans #13955
    2. Context compaction loses CLAUDE.md guidelines #19736
    3. Claude should verify technical claims in plans before executing #19819

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  3. devinhedge commented on Jan 24, 2026

    @devinhedge
    Author

    It is the FEATURE request response to #19736

    Which has a better description?

  4. github-actions commented on Feb 27, 2026

    @github-actions

    Closing for now — inactive for too long. Please open a new issue if this is still relevant.

  5. github-actions commented on Mar 7, 2026

    @github-actions

    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.

  6. locked as resolved and limited conversation to collaborators on Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions