opencode icon indicating copy to clipboard operation
opencode copied to clipboard

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

Open SYRS-AI opened this issue 3 days ago • 1 comments

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)

SYRS-AI avatar Jan 12 '26 09:01 SYRS-AI