hermes - 💡(How to fix) Fix Feature: rewind/edit-and-resubmit (like Claude Code's double-Esc)

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Add a first-class "rewind" affordance to jump back to a prior user message in the current session and re-prompt from there, discarding everything after. Equivalent to Claude Code's double-Esc behavior.

Root Cause

Add a first-class "rewind" affordance to jump back to a prior user message in the current session and re-prompt from there, discarding everything after. Equivalent to Claude Code's double-Esc behavior.

RAW_BUFFERClick to expand / collapse

Summary

Add a first-class "rewind" affordance to jump back to a prior user message in the current session and re-prompt from there, discarding everything after. Equivalent to Claude Code's double-Esc behavior.

Motivation

When a turn goes off the rails (bad tool call cascade, misunderstood intent, polluted context), the user's options today are:

  • /new — nukes the whole session, loses durable context
  • /branch — forks into a new session (good for exploration, not for "undo")
  • Manually tell the agent "ignore that, instead..." — context is still polluted, model has already committed to a direction, wastes tokens

There's no clean "back up two turns and try again" primitive. This is the single biggest UX gap relative to Claude Code for users coming from that tool.

Proposed UX

  • /rewind (and a keybind, e.g. double-Esc in CLI / TUI) opens a picker showing the last N user messages
  • User selects a target message; transcript is truncated to just before that message; cursor lands in the input prompt pre-filled with the selected message text (editable)
  • Submitting replays from that point — all messages, tool calls, and assistant turns after the rewind point are dropped from the active context
  • Rewind point is a soft delete in the SQLite session store (recoverable / inspectable), not a hard truncate, so session_search and audit can still see what was rewound

Scope

  • CLI (prompt_toolkit) + TUI (Ink) bindings
  • SessionDB needs a "truncate-after" or "active head" pointer — rewound rows kept on disk, marked inactive
  • Memory providers should be notified (similar to #6672 for /resume and /branch) so memory state matches the active head
  • Gateway platforms (Telegram/Discord/etc.) — out of scope for v1; CLI/TUI only

Related

  • #11030 — /branch reliability bug
  • #20856 — /branch sessions disappearing
  • #6672 — memory provider notifications on session switches

/branch is a sibling primitive (fork into new session) but doesn't solve the in-place undo case.

Acceptance

  • /rewind command + double-Esc keybind in CLI and TUI
  • Truncated transcript no longer shown to the model on the next turn
  • Rewound rows preserved in SessionDB (inactive flag), not deleted
  • Memory providers notified on rewind
  • Tests covering: rewind to first user message, rewind mid-session, rewind then continue normally, rewind across tool-call boundaries

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix Feature: rewind/edit-and-resubmit (like Claude Code's double-Esc)