You correct it, it fixes the immediate instance, then repeats the mistake elsewhere. Could be a style issue, a pattern it keeps reverting to, or a wrong assumption baked into the session.
1
Name the pattern explicitly. Don't just fix the symptom — identify the rule being broken and state it clearly.
2
Add it as an explicit constraint in your next prompt: "Never do X. Always use Y instead. This applies to every piece of code in this session."
3
If it persists across 3+ corrections, start a new session with the rule stated in the very first message before any task.
Recovery prompt
You keep [describe the pattern]. This is wrong because [reason].
The correct approach is [describe it specifically].
This rule applies to every piece of code you write in this session.
Now re-do the last output following this rule.