/rewind 功能相关
What feature would you like to see?
我希望有 /rewind功能,而且不需要强制要求项目用 git ,类似 claude code的 /rewind能力
Additional information
No response
/rewind、/undo 这个功能真的是会话上下文构建的核心,请尽快支持 🥺
Adding context from the legacy kimi-cli side: I filed the same user-facing request there as MoonshotAI/kimi-cli#2290 because Kimi CLI is evolving into Kimi Code CLI.
The behavior I want is the Claude Code-style rewind/checkpoint flow: choose an earlier turn/checkpoint, restore the conversation state, and ideally restore file changes from that point in a predictable way. This issue looks like the right place to track the kimi-code version instead of opening a duplicate.
刚需功能啊
刚准备切到Kimi-Code CLI,但没有/rewind真的下不了决心。
和上面几位一样,我也是因为缺少这个功能而犹豫是否全面切换过来。
补充一些具体的使用场景说明这个问题有多痛:
目前 /undo 的行为只是从会话上下文中移除提示词,但不会回滚该提示词引发的文件修改(见官方文档描述:"从当前上下文撤销最近的提示词")。这意味着:
- undo 后代码库处于一个"脏"状态——修改还在,但 AI 已经不记得自己改了什么
- 用户必须手动
git checkout .恢复,还要知道改了哪些文件 - 在实际开发中,undo 几乎总是意味着"我刚才说的不对,把改动也撤回",纯撤消息用途很小
对比之下,Claude Code 的 checkpoint/rewind 可以原子性地同时恢复对话状态和文件状态,CURSOR 也有类似的回退能力。这是 Agent 式编程工作流里的核心体验,直接影响迭代效率。
希望官方能关注这个需求,哪怕先做个最小可行版本(比如只追踪 Write/Edit 工具修改的文件,存储 diff 快照)也好。🙏
So strange, how come this important feature is missing for such a long time?
I can see there is an /undo command in verison 0.27.0
I traced the current implementation before proposing a PR. /undo now has a selector and correctly removes recent user turns from active context, but it deliberately does not restore filesystem state. That leaves the core request here unresolved.
There are two materially different implementation directions:
- Tool-owned checkpoints: record reversible before-images for
Write/Editoperations per user turn. This is bounded and predictable, but cannot honestly restore arbitrary changes made byBash. - Workspace snapshots: create a content-addressed snapshot at each user-turn boundary so
Bashchanges can also be detected/restored without requiring Git. This is more complete, but needs explicit policies for ignored files, symlinks, large/binary files, concurrent external edits, and changes outside the workspace.
I do not want to submit a partial Write/Edit implementation while calling it Claude-style rewind. My proposed PR would use the second model with a preflight preview and fail closed on conflicts, while limiting snapshots to workspace roots and storing deduplicated content under the session data directory.
Is that the intended product direction, or would maintainers prefer the narrower tool-owned MVP?