[FEATURE] Undo message only - keep file changes (like Claude Code)
Feature Request
Add an option to undo/remove AI messages from conversation history while preserving file changes.
Current Behavior
The /undo command reverts both:
- The conversation message
- The file changes made by AI
There's no way to keep the file changes while cleaning up the conversation history.
Requested Behavior
Add a new command or option like:
/undo --keep-filesor/undo -k/forget(removes message only)- Or a separate UI button for "Remove message, keep changes"
Use Cases
-
Conversation cleanup: After AI makes correct changes through multiple back-and-forth messages, I want to clean up the messy conversation history while keeping the final working code.
-
Context management: Long conversations eat up context window. Being able to remove old messages while keeping their file changes helps manage context efficiently.
-
Iterative development: AI made changes across 5 messages. The code is good now, but I don't need all that conversation history cluttering my session.
Prior Art
Claude Code has this feature - you can undo messages while preserving file changes. It's extremely useful for keeping conversations clean without losing work.
Environment
- OS: Windows 11
- OpenCode version: Latest
Related Issues
- #5474 (opposite problem - wants file changes to also revert)
- #7712 (edit context to delete messages)
- #4681 (redoable parameter for revert)