[FEATURE] Undo message only - keep file changes (like Claude Code) #4840

Open
opened 2026-02-16 17:45:38 -05:00 by yindo · 2 comments
Owner

Originally created by @SYRS-AI on GitHub (Jan 12, 2026).

Originally assigned to: @thdxr on GitHub.

Feature Request

Add an option to undo/remove AI messages from conversation history while preserving file changes.

Current Behavior

The /undo command reverts both:

  1. The conversation message
  2. 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-files or /undo -k
  • /forget (removes message only)
  • Or a separate UI button for "Remove message, keep changes"

Use Cases

  1. 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.

  2. Context management: Long conversations eat up context window. Being able to remove old messages while keeping their file changes helps manage context efficiently.

  3. 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)
Originally created by @SYRS-AI on GitHub (Jan 12, 2026). Originally assigned to: @thdxr on GitHub. ### Feature Request Add an option to **undo/remove AI messages from conversation history while preserving file changes**. ### Current Behavior The `/undo` command reverts both: 1. The conversation message 2. 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-files` or `/undo -k` - `/forget` (removes message only) - Or a separate UI button for "Remove message, keep changes" ### Use Cases 1. **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. 2. **Context management**: Long conversations eat up context window. Being able to remove old messages while keeping their file changes helps manage context efficiently. 3. **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)
yindo added the windows label 2026-02-16 17:45:38 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 12, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #5474: /undo command only rolls back AI conversation message, not the associated file changes (opposite problem - wants file changes to also revert)
  • #7712: Feature request to edit/delete individual messages and parts from context without losing the entire message
  • #4681: Feature request to add redoable parameter to control permanent message deletion after revert

These issues discuss related functionality around managing conversation history and file changes. Feel free to ignore if your specific use case differs from these.

@github-actions[bot] commented on GitHub (Jan 12, 2026): This issue might be a duplicate of existing issues. Please check: - #5474: `/undo` command only rolls back AI conversation message, not the associated file changes (opposite problem - wants file changes to also revert) - #7712: Feature request to edit/delete individual messages and parts from context without losing the entire message - #4681: Feature request to add `redoable` parameter to control permanent message deletion after revert These issues discuss related functionality around managing conversation history and file changes. Feel free to ignore if your specific use case differs from these.
Author
Owner

@IgorWarzocha commented on GitHub (Jan 31, 2026):

@SYRS-AI you're looking for

},
  "snapshot": false
}

in your global opencode.json

@IgorWarzocha commented on GitHub (Jan 31, 2026): @SYRS-AI you're looking for ``` }, "snapshot": false } ``` in your global opencode.json
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4840