I had a similar anecdotal experience a few weeks ago.

I was working on a blog entry in a VS Code window and I hadn't yet saved it to disk. Then I accidentally hit the close-window keyboard shortcut... and it was gone. The "open last closed window" feature didn't recover it.

On a hunch, I ran some rg searches in my VS Code Library feature on fragments of text I could remember from what I had written... and it turned out there was a VS Code Copilot log file with a bunch of JSON in it that recorded a recent transaction with their backend - and contained the text I had lost.

I grabbed a copy of that file and ran it through my (vibe-coded) JSON string extraction tool https://tools.simonwillison.net/json-string-extractor to get my work back.

Looking back, writing interrupt service routines[1] for DOS as a self-taught teenager has been massively helpful.

Primarly because it taught me to save every other word or so, in case my ISR caused the machine to freeze.

[1]: https://wiki.osdev.org/Interrupt_Service_Routines

Programmer from DOS times here. I've ingrained pressing CTRL + S every few seconds as a reflex. That has saved my bacon more than a few times.

There's an option now in vscode to autosave every few seconds.

If you can't remember what you wrote a 'few seconds' ago then you have more problems than having to work in vscode!

I have ADHD bro

It's called aging. Just wait until the first time you head back down the hall from the living room to the bedroom to get the thing you forgot to bring with you, get distracted for a moment by a pet or family member, and then can't remember if you were going down the hall to the bedroom or the living room.

[dead]