r/PromptEngineering • • 16h ago

Prompt Text / Showcase How I stopped ChatGPT, Claude, and Gemini from hallucinating and forgetting rules on long projects (Copy-Paste State Protocol)

22 Upvotes

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:

  1. Tag every claim using ONLY: `[VERIFIED]` (proven by tool/file/user), `[DECISION]` (explicitly agreed rule), `[HYPOTHESIS]` (unproven idea), or `[UNKNOWN]` (missing data).
  2. Create a dedicated section called 'REJECTED / DO NOT REPEAT' listing approaches we already ruled out and why.
  3. Do NOT invent missing numbers or URLs. If something is missing, mark it `[UNKNOWN]`.
  4. 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.


r/PromptEngineering • • 9h ago

General Discussion How often do you rerun evals after a prompt change?

2 Upvotes

Every small prompt tweak seems to fix one thing and quietly break another. Do you rerun your full eval suite on every change, or just a subset? How long does your run take?


r/PromptEngineering • • 15h ago

Prompt Text / Showcase I built a free tool to compare two prompts side-by-side - with a live word diff

2 Upvotes

I kept rewriting prompts and forgetting what I actually changed, so I built PromptDiff.

Paste two versions of a prompt, it shows a live word-by-word diff- green additions, red removals - with a similarity score, added / removed/ unchanged counts, and token + cost estimates.

It has 280 built-in examples to try, and {{variables}} in a prompt automatically become fill-in test fields. Free, no account, works on phone:

https://muse.ai/s/promptdiff-xfz75r1xwxgt1h/ucQWPGvITUnzZFRt5g7iF-Cj45ld_RLD6mKmAwy2UEg


r/PromptEngineering • • 18h ago

General Discussion what would a good "im not sure" answer from an AI even look like

4 Upvotes

someone in my last thread said the best version is when it marks the exact sentence it cant back up, right next to that sentence, not one confidence score on the whole answer. so like "renews in march (not sure, couldnt find the date, maybe 40%)" and everything it does have a source for just stays plain

idk if that gets annoying in the middle of a long answer tho. anyone already doing this? what do you put in the prompt


r/PromptEngineering • • 20h ago

Tips and Tricks 147. Telling the model what to do when it doesn't know fixed most of my bad answers

1 Upvotes

Simple one but it made a big difference for me. I have a prompt that answers questions about our internal HR policies from a pasted document. It used to answer confidently even when the answer wasn't in the document, mixing in general knowledge.

I added one line: "If the answer isn't in the document, say 'not covered in the policy' and suggest who to ask." Made-up answers dropped a lot in my testing, around 50 questions where maybe 10 aren't covered.

Feels obvious now, but I'd been focusing on how to answer and never on what to do when there's no answer.


r/PromptEngineering • • 22h ago

General Discussion 145. Examples in prompts helped me more than any amount of instructions

2 Upvotes

For months I kept adding rules to a prompt that writes short product descriptions. Tone rules, length rules, banned words, all of it. Outputs got a little better each time but still felt off.

Last week I deleted most of the rules and pasted in three descriptions I'd written myself that I liked. The outputs got much closer to what I wanted right away. Fewer rules, better results.

Now my default is a short instruction plus two or three real examples, and I only add a rule when it keeps making the same mistake. Curious if others found the same, or if there are tasks where examples made things worse.


r/PromptEngineering • • 2h ago

General Discussion Ughh !! It's me or sometimes this ai can understand my instructions, it's frustrating sometimes to convey the proper commands through normal english in specific tasks.

2 Upvotes

I mean i should take lessons in prompt engineering or learn to command better, coz it's time consuming and token wasting to get job done the way i am doing currently. So anything that can help me to improve at this??