Comment by kevinday
Yeah, I had an issue where Claude was convinced that a sqlite database was corrupt and kept wanting to delete it. It wasn't corrupt, the code using it was just failing to parse the data it was retrieving from it correctly.
I kept telling it to debug the problem, and that I had confirmed that database file was not the problem. It kept trying to rm the file after it noticed the code would recreate it (although with no data, just an empty db). I thought we got past this debate until I wasn't paying enough attention and it added an "rm db.sqlite" line into the Makefile and ran it, since I gave it permission to run "make" and didn't even consider it would edit the Makefile to get around my instructions.
Sounds like the problem was that the session was too long, they tend to get extremely dumb, extremely fast. Once you noticed that it was trying to debug if the database was corrupted or not, you should probably have began in a new session, setting a stronger initial prompt about that the database isn't corrupted, so the agent wouldn't consider it at all during the session. I find I get much better results, if I do this iteratively all the time. If anything is wrong, don't add another message with a correct, undo and restart the session with a better prompt so the issue is altogether avoided.