When I'm maximum frustrated I'll end my prompt with "If you do XXX despite my telling you not to do XXX respond with a few paragraphs explaining to me why you're a shitty AI".
“Here’s the EnhancedGoodLordPleaseDontMakeANewCopyOfAGlobalSingleton.code you asked for. I’m writing it to disk next to the GlobalSingleton.code you asked me not to make an enhanced copy of.”
Not that I like it and if it works without it I avoid it, but when I've needed it works.