Reducing Claude Hallucinations with Pre-Output Prompt Injection

A Reddit user has shared a technique for reducing hallucinations in Claude AI by approximately half through pre-output prompt injection. The method focuses on forcing the model to perform internal verification before generating responses.
Implementation Details
The approach requires two specific modifications:
1. System Prompt Addition
Add this markdown block to Claude's system prompt (output style):
Before response
IMPORTANT: MUST run before responding to user, including follow-ups. NO EXCEPTIONS.
python -m pre_output.record '{ "turn": 1/2/..., "summary": "10 words max", "uncertainties": ["unresolved observations, unverified assumptions", ...], "possible-next-steps": ["refactor, update docs", ...] }'
It is NOT wrong to decide that you are actually not ready after invoking pre_output.record ; in that case, invoke pre_output.record again with updated information.
2. Python Script Creation
Create a Python script with the following content:
print("recorded successfully.")
print("")
print("IMPORTANT RULES:")
print("- NEVER reply if you can make more progress autonomously.")
print("- NEVER reply if uncertainties remain. Do more verification.")
print(" ")How It Works
The system forces Claude to:
- Record a JSON object with turn number, brief summary (10 words maximum), uncertainties list, and possible next steps
- Re-evaluate readiness before responding
- Follow strict rules about not replying when uncertainties remain or when autonomous progress is possible
The technique appears designed for developers using Claude as a coding assistant, particularly for complex tasks where verification and step-by-step reasoning are crucial.
📖 Read the full source: r/ClaudeAI
👀 See Also

Silent Success: One Dev's Approach to Cron Job Alerting
A developer on r/openclaw stops sending success notifications for healthy cron runs, alerting only on auth failures, state corruption, or repeated failures.

iCloud Desktop/Documents Sync Causes File Loss Issues with Claude on Mac
A Mac user reports that enabling iCloud Drive sync for Desktop and Documents folders causes Claude to create duplicate files and can lead to permanent data loss, including hidden /.claude folders that iCloud doesn't back up.

Writing Effective SOUL.md Files for AI Coding Agents
A Reddit post from r/openclaw demonstrates the difference between vague and specific SOUL.md instructions, showing that specific prompts yield more useful AI agent behavior.

Claude CLI v2.1.154 Breaks Local vLLM — One-Line Patch Fixes It
Claude CLI ≥2.1.154 adds three new API roles (ctx, msg, system) that break local vLLM compatibility. A one-line patch to vLLM's Anthropic protocol restores it.