[BUG] VSCode Extension: Undo restores code but does not revert conversation state or resume from that message
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When using the Undo feature in the VS Code extension of Claude Code, the editor correctly restores the previous code state, but the conversation timeline is NOT reverted.
Claude continues the session as if the undone messages and actions still exist in context.
As a result:
- The file content is restored to a previous version
- The conversation history remains at the latest point
- Claude does NOT resume from the message where the undone change originated
- Subsequent responses may reference code that no longer exists
This creates a mismatch between the code state and the conversational context.
What Should Happen?
Undo should revert BOTH:
- The workspace/code state
- The conversation state
Claude should resume from the exact message where the undone change was introduced, as if later messages never happened.
After undo:
- Conversation history should rewind
- Context should match the restored code
- Claude should continue from that point
Error Messages/Logs
No explicit error message is shown.
The issue manifests as incorrect session state and context mismatch rather than a runtime error.
Steps to Reproduce
- Open VS Code with Claude Code extension installed
- Start a Claude session in a workspace
- Ask Claude to modify a file (e.g., refactor or add code)
- Accept the changes so the file is updated
- Continue the conversation with additional prompts
- Use Undo to revert the file changes by clicking the message whichever you want
- Observe that the file code changes returns to its previous state
- Ask Claude another question about the file
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
N/A
Claude Code Version
2.1.61
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
This behavior can lead to incorrect code suggestions, confusion, and potential errors because the assistant's internal context no longer matches the actual workspace state.
It would be helpful if Undo either:
- Rewound the conversation automatically, OR
- Displayed a warning about context mismatch, OR
- Provided a dedicated "Revert session to this point" feature
Related observation:
Other features like conversation forking or session restore suggest that conversation state and workspace state are tracked separately.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗