Under the plugin architecture of DeepSeek Harness (dsh), developers often need to roll back conversation history or fix code changes. The dsh-rewind plugin ports the rewind capability from Claude Code to dsh, allowing users to reference a historical message and roll back the conversation, the code, or both to that point in time, or start a summarized branch from there.

Plugin Overview

dsh-rewind is a third-party workflow plugin maintained by SipengXie2024 and licensed under the MIT License. It replaces the user message renderer on the dsh client side, and works with the host-side RPC gateway and capture middleware to capture and restore file snapshots.

Core Features

The plugin provides menu items corresponding to the Claude Code rewind popup menu:

  1. Restore Conversation (Edit and Rerun)
    The bubble becomes an inline editor. After confirmation, it forks to the previous turn/end boundary, opens a sub-session, and resends the rewritten message.

  2. Restore Conversation and Code
    Before forking, it displays a file rollback card. Upon confirmation, it first restores the selected files to their pre-boundary content, then forks and reruns.

  3. Restore Code Only
    It only restores files, without forking or sending a message, and remains in the current session.

  4. Summarize Up to Here and Start a New Branch
    Fork (including the clicked turn) → open a branch → automatically run /compact to compress the earlier history.

The plugin supports capturing changes made by the write, edit, and str_replace_editor tools. When the menu is opened, it probes the number of file changes in parallel and grays out the corresponding option if there are no changes. It supports 14-day automatic GC (garbage collection) and hot reloading (/reload dsh-rewind).

Installation and Enablement

Before installing, make sure the installation package has been built.

1、Build the plugin

npm run build
npm pack

2、Install the plugin

dsh plugin --profile web add dsh-rewind-<version>.tgz

3、Configure parameters
Add the following configuration to dsh’s settings.yaml:

rewind:
  captureEnabled: true   # 关掉即停止捕获(已有快照不动)
  retentionDays: 14      # 0 = 立即全部过期(下次扫描清空)
  maxFileBytes: 10485760 # 超过此大小的改前内容不入库(标 lost)

Typical Usage

After installation and configuration, find any user message in the conversation history and click the rewind menu that appears to perform the operation. The menu allows you to confirm file changes visually and executes the corresponding recovery logic after confirmation.

Use Cases and Boundaries

This plugin is suitable for developers who need fine-grained control over conversation history and code changes.

Note the following boundary conditions:

  • Side-effecting tools such as bash are not covered: Only the three structured writing tools are captured; files written or commands executed by the model via bash cannot be rolled back.
  • Recovery does not go through an approval gate: Files are written directly, and no sandbox escalation prompt is triggered.
  • Rerunning messages with images: It reads attachments, converts them to base64, and resends them; if reading fails, it falls back to plain text resending and shows a notification.
  • No rewind button for steering messages: Forking is turn-granular, and interjections within a turn have no independent boundary.
  • Rewind is disabled for the first user message: There is no previous turn boundary to return to.
  • Files created by create are only reported and must be deleted manually: The plugin does not delete files; they must be handled manually.

dsh-rewind provides dsh users with time-travel-like debugging capabilities through its file snapshot mechanism and boundary control. For more details, see the official catalog or the source code.