r/PromptEngineering • u/Most-Read-9729 • 16h ago
Prompt Text / Showcase How I stopped ChatGPT, Claude, and Gemini from hallucinating and forgetting rules on long projects (Copy-Paste State Protocol)
Whenever a thread gets too long or I switch between ChatGPT, Claude, and Gemini, asking for a normal "summary" always backfires. The model starts mixing up old ideas I already rejected with current decisions, or just guesses missing details.
What actually worked for me is forcing the AI to spit out a strict state file (`PROJECT_STATE.md`) before I close a chat, tagging every line so it can't mix facts with guesses.
Here is the prompt I paste at the end of a session:
"Act as a strict Technical Archivist. Reconstruct the current state of our project into a clean Markdown block called `PROJECT_STATE.md`. Follow these 4 rules:
- Tag every claim using ONLY: `[VERIFIED]` (proven by tool/file/user), `[DECISION]` (explicitly agreed rule), `[HYPOTHESIS]` (unproven idea), or `[UNKNOWN]` (missing data).
- Create a dedicated section called 'REJECTED / DO NOT REPEAT' listing approaches we already ruled out and why.
- Do NOT invent missing numbers or URLs. If something is missing, mark it `[UNKNOWN]`.
- Keep it concise and ready to be pasted into a fresh AI session."
Then I just paste that block at the start of a new chat. It saves a ton of time repeating myself. Figured I'd share it here in case anyone else is dealing with context drift.