Unsaved work lost after accidental VS Code window close β no recovery prompt
Hello Maintainers π,
I would like to report a usability issue that can lead to loss of work, especially during long development sessions.
β Problem Description
Sometimes I spend a long time thinking or planning, without actively typing code for a while. During this time, the editor remains open and everything seems fine.
However, if the VS Code window is accidentally closed (by mistake or system interruption), all unsaved work is lost, and there is no way to restore or continue from where I left off.
This can be frustrating, particularly when:
- You are mentally planning or reviewing code
- You step away briefly
- The window is closed unintentionally
- No auto-save or recovery prompt appears
π Expected Behavior
One or more of the following would be very helpful:
- A warning or confirmation dialog before closing when unsaved context exists
- Better automatic session recovery
- Optional background auto-save / draft snapshot
- Ability to resume work context even after accidental closure
π― Why This Matters
Accidental window closures are common, and losing work β even thinking-stage or partially written content β can negatively impact productivity and learning, especially for students and developers.
π Request
Please consider improving recovery or warning mechanisms to help users continue their work safely after unexpected closures.
Thank you for your time and for the amazing work you do on this project.
Best regards,
Rashid Zada
---
π·οΈ Optional Labels (if available)
bugusabilitydata-lossenhancement
2 Comments
You said there's "unsaved work". Can you say more? I presume that you're not talking about modifications to your code files, because those changes are immediately persisted to disk. You're probably talking about the events that comprise the conversation thread βΒ user prompts, tool calls, and "thoughts". Those are also stored to disk. You can find them in your
~/.codex/sessions/directory.Within the Codex IDE panel, you can restart a past session from the point where you left off. At most, you might lose the results of the last tool call if it was canceled when you closed your window.
As an alternative to local sessions, you can use the Codex Web to run longer sessions in the cloud. That way, your longer sessions will continue to run even if you shut down your local computer or put your laptop to sleep. You can even move sessions between local and the cloud (and vice versa). Refer to this documentation for details.
Thank you for kind suggestions
On Sun, Jan 18, 2026, 10:20 PM Eric Traut @.***> wrote: