The unsaved changes trap

This happened to me recently, I wanted to share.

I’m developing a web ts project. I moved a function call from one file to another and saved the latter, but not the former.
The app behaved as if it was calling the function twice (which it was, since the call was still in both places). I started clearing caches everywhere… but unsurprisingly, that didn’t help.

I asked Claude for help. It searched for the function and found it in both places. But when it started reading the file, it got really confused, because it appeared the function wasn’t there anymore. So we were both befuddled.

What I learned is that Claude searches the saved files but reads from the live, unsaved editor. And it’s not aware of this nuance.