Gemini hallucinating - no code being written

Telling me it has implemented changes when no code has been written. After experiencing the painful loss of 5 hours coding work (I wasn’t aware that it was just a sandbox), I connected my Github and did an initial commit. But it begins to just report changes & no code produced.

So I want to know from others what is their best work around, please.

I have setup system instruction guardrails & product brief, roadmap, an architecture-decision-log & -development-log

If I don’t find a suitable work around, I’ll not use it even though I love the screen annotation feature - it was one of my bugbears in all other AI dev environments

Maybe it’s because I’m not doing one shot vibe coding with Ai studio, I don’t know? I usually have many changes and additions to add which then begins to hallucinate. I know it’s a context full issue but others must have some similar experiences & have worked out the best way to work around this?