kimi-code icon indicating copy to clipboard operation
kimi-code copied to clipboard

[Feature Request] Add checkpoint / rewind support (restore conversation + file state to previous turn)

Open djfch opened this issue 6 months ago • 1 comments

Feature Request: Add checkpoint / rewind support (restore conversation + file state to a previous turn)

What problem are you trying to solve?

Currently, when the AI makes a series of file edits that go in the wrong direction, there is no easy way to atomically revert both the conversation and the code back to a specific point.

Claude Code solves this elegantly with its Checkpoint/Rewind feature:

  • Every user prompt automatically creates a checkpoint
  • Double-press Esc or run /rewind to open a history menu
  • Choose a turn and select:
    • Restore code and conversation — revert files + rewind chat
    • Restore conversation only — keep files, rewind chat
    • Restore code only — revert files, keep chat

What is the desired behavior?

I would like kimi-code to support a similar checkpoint mechanism. Specifically:

  1. Automatic checkpoints: Before each turn (or before each file-modifying tool call), silently save a snapshot of modified files.
  2. /rewind command (or double-ESC): Open an interactive menu listing historical turns.
  3. Restore options:
    • Restore conversation + code (full rewind)
    • Restore conversation only
    • Restore code only
  4. Scope limitation: Similar to Claude Code, changes made by Shell tool or manual external edits may be out of scope for tracking.

Why is this important?

In long agentic coding sessions, the AI often goes down a wrong path after several turns. Without checkpoint rewind, users must:

  • Manually git diff and git checkout to revert files
  • Or abandon the session and start over
  • Or leave the working directory in a messy state

This breaks the flow of iterative AI-assisted development.

Alternatives considered

  • /compact: This compresses context but does not revert state.
  • Manual git: Requires users to remember to commit before every prompt, which is unrealistic.

Additional context

If full automatic checkpointing is too heavy for the initial implementation, a lighter version could be:

  • Only track files modified via WriteFile / StrReplaceFile tools
  • Store diffs in session metadata
  • Expose /rewind as a CLI command first, TUI shortcut later

Thank you for considering this!

djfch avatar May 28 '26 08:05 djfch

Yes, there is a similar rollback in CURSOR, very convenient

alekssskirov avatar May 30 '26 20:05 alekssskirov