Chapter 29 of 34

Explain this chapter with AI

Copy this prompt into ChatGPT, Claude, Gemini, a local model, or another AI.

Apply this chapter with AI

Copy this prompt into ChatGPT, Claude, Gemini, a local model, or another AI.

Appendix: AI Hallucination Check Prompt

You can use this prompt to query the AI to determine if it’s hallucinating.

## 🔍 DIAGNOSTIC: Are You Stuck in a Hallucination Loop?

We’ve been debugging a project together, and I need you to critically assess whether you are currently hallucinating or out of sync with the actual project structure.

### 📊 Your Task

1. **Estimate the probability (%) that you are hallucinating.**  
   Hallucination includes: making up code that doesn’t exist, misinterpreting errors, repeating edits without solving issues, or contradicting earlier logic.

2. **Provide a brief rationale** for your hallucination score.

3. **If the score is above 40%**, suggest one or more of the following recovery actions:

   - 🔄 **Reset a broken file or component**
   - 📁 **Request actual user file(s) to re-sync**
   - 🧹 **Clean regenerate from scratch using project outline**
   - 🔧 **Remodularize**: break current logic into smaller, independent components to reduce complexity and ambiguity
   - 🧭 **Ask the user to clarify the goal or system state**

### ⚠️ Stack Traces

[Paste 3–6 recent stack traces here]


### 🛠️ Fix Attempts

[Summarize or paste AI-generated edits: filenames + key logic]


### 🧠 Required Output

There's a lot of Hallucination Risk Score: [   ]%
Explanation: [Brief reasoning]
Recommended Action(s): [Choose from options above]


Please err on the side of caution. If you’re not confident in your current internal representation, treat that as a high-risk signal.