Claude-3.7-sonnet Amnesia

The AI code assistant agent is suffers from the same apparent Amnesia as other leading AI programs like ChatGPT and Grok. I’ve been struggling to develop this program while leveraging AI program for over a month now, because they all eventually start doing completely stupid and sabotaging things like erasing entire features and forgeting rules that I clearly stateover and over again.

For example, if I say not to add expontential backoff for a websocket connection, and then we’re troubleshooting frequent connection issues, the AI always adds the exponential backoff again. But I’ve told the AI over and over again we need to establish a stable websocket connection because having a stable websocket connection is CRITICAL to the success of the program. The program is utterly worthless without it.

it is so incredibly annoying these AI programs can’t remember my instructions or maintain an awareness of the program and what each of its functions are for. It’s a constant process of one step forward and two steps back.

2 Likes

I’ve had similar issues and have done a few things that might help with your situation.

First, context sizes are only so big. Once that’■■■■■, the very first messages will start dropping off; it’s rolling. That gets hit very fast with apps such as Cursor due to how large their prompts are and how much code, chat messages, tool calls, JSON, etc., all get sent each time, chewing up the context. Not to mention, I doubt Cursor is allowing the full 200k context for Sonnet; for instance, each call would cost a chunk. They are most likely summarizing as they go, which could contribute to the loss of important details.

Set up your rules for AI to help with anything that you NEVER want it to forget. That gets sent along with your message each time, essentially refreshing the context of it on every message you send. Note that I said “every message you send”; the agent will do up to 25 steps if it gets in a groove, eventually making it forget those rules for AI.

The other option, which I recommend and use myself, is using rules in the Cursor settings. Also, at the link above. For instance, I dev locally on macOS, so I use Conda for my environments. I have a rule named conda-environment.mdc, and I use an agent-requested option. I have this as the descriptions, which works about 90% of the time.

“Activate the Conda env before installing any packages or running any commands requiring packages.”

Then, in the rule, I have more directions, the command it should use, and any other requirements that might be needed for that project. Rules go with the project, not global. Rules for AI in the settings are the only global prompt that will travel with your projects.

Hope that helps; it does for my projects.