Skip to content
Back to search

dsh-rewind

DSH 插件:便捷无感的同窗口内对话回退,从不新建分支;自带轻量工作区备份,可一并还原文件(Claude Code /rewind 语义)。 · DSH plugin: effortless in-window conversation rewind — never forking a new session; ships a lightweight workspace backup that restores files together with the rewind (Claude Code /rewind semantics).

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/SiriLee/dsh-rewind with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/SiriLee/dsh-rewind'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/sirilee--dsh-rewind/badge.svg)](/listings/sirilee--dsh-rewind)

HTML

<a href="/listings/sirilee--dsh-rewind"><img src="/api/listings/sirilee--dsh-rewind/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

确认本机 DSH 版本后,在 [Release](https://github.com/SiriLee/dsh-rewind/releases) 找到适配的插件版本。

**命令行**:

dsh plugin --profile <name> add dsh-rewind-plugin@<版本>

**图形界面**:侧栏「插件」页 →「添加插件」→ 填 `dsh-rewind-plugin@<版本>` → 安装 → 重启 DSH 并刷新浏览器。

<img src="assets/screenshots/add-plugin.png" width="600" alt="「添加插件」弹窗:在输入框填入 dsh-rewind-plugin@版本号"><br> <sub>图片仅为示例,请以实际适配版本号为准。</sub>

**更新**:命令行可直接覆盖安装;图形界面会拒绝重复安装,需先卸载旧版本,再装新版本。

> [!WARNING] > npm 上的 `dsh-rewind` 属于其他作者,请用 `dsh-rewind-plugin` 安装。

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 187 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # dsh-rewind
  2. DeepSeek Harness plugin: **in-window conversation rewind to any earlier user message**.<br />No forking, no window switch, with optional workspace-file restore — Claude Code-style `/rewind` semantics.
  3. English | [中文](README.zh.md)
  4. [![npm version](https://img.shields.io/npm/v/dsh-rewind-plugin.svg)](https://www.npmjs.com/package/dsh-rewind-plugin)
  5. [![npm downloads](https://img.shields.io/npm/dt/dsh-rewind-plugin.svg)](https://www.npmjs.com/package/dsh-rewind-plugin)
  6. [![tests](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FSiriLee%2Fdb3b9260351c2b26eb3d201c2ed29df1%2Fraw%2Fbadge.json)](https://github.com/SiriLee/dsh-rewind/actions/workflows/ci.yml)
  7. ![Rewind to an earlier message, with optional file restore](docs/preview.svg)
  8. A deliberately focused plugin with one job: **rewind to any user message, no matter how far back, in place** — and conveniently **restore the files it changed** along the way.
  9. - **In-place rewind, no new session** — the target message and everything after it are withdrawn from the model context *and* the rendered transcript, and the target's prompt is restored into the input field so you can re-send or edit it. It all happens inside the original session: no new branch, no leftover copy.
  10. - **Conversation and files rewind together** — Claude Code-aligned behavior: automatically tracks DSH's file edits as you work, allowing you to quickly undo changes and rewind to previous states if anything gets off track.
  11. - **Safety guarantees** — the session log only ever appends rewind markers and is never deleted or rewritten; file backup and restore are hardened; tests are comprehensive, and maintenance continues across DSH upgrades. Security model: [docs/security-model.md](docs/security-model.md).
  12. ## Preview
  13. Every user message carries a **↶ rewind** button in its action row. Clicking it opens a mode-selection popover — "**rewind conversation only**" or "**rewind conversation and files**", the latter showing the file-change list for confirmation first. You can also pick and rewind conveniently via the **`/rewind` and `/undo` commands**.
  14. <table>
  15. <tr>
  16. <td align="center"><img src="assets/screenshots/rewind-button.png" width="440" alt="Per-message ↶ rewind button"><br><sub>Per-message ↶ rewind button</sub></td>
  17. <td align="center"><img src="assets/screenshots/mode-popover.png" width="440" alt="Mode-selection popover"><br><sub>Mode-selection popover</sub></td>
  18. </tr>
  19. <tr>
  20. <td align="center"><img src="assets/screenshots/impact-list.png" width="440" alt="Impact list"><br><sub>"Conversation and files" impact list</sub></td>
  21. <td align="center"><img src="assets/screenshots/rewind-candidates.png" width="440" alt="/rewind candidate picker"><br><sub>/rewind candidate picker</sub></td>
  22. </tr>
  23. </table>
  24. ## Install
  25. **Command line**:
  26. ```sh
  27. dsh plugin --profile <name> add dsh-rewind-plugin
  28. ```
  29. **Graphical interface**: the **Plugins** page → **Add plugin** → enter `dsh-rewind-plugin` → install.
  30. <img src="assets/screenshots/add-plugin.png" width="600" alt="Add plugin dialog: enter dsh-rewind-plugin in the field"><br>
  31. The default install is built for the latest stable DSH release. If you are on a different DSH version, find a matching one in [Releases](https://github.com/SiriLee/dsh-rewind/releases).
  32. > [!WARNING]
  33. > The npm name `dsh-rewind` belongs to another author's package — install with `dsh-rewind-plugin`.
  34. ## Usage
  35. 1. Find the user message you want to rewind to in the conversation, or type `/rewind` (or its alias `/undo`) to open the rewind menu.
  36. 2. **Select it.** A small popover offers the two modes — "conversation only" or "conversation and files".
  37. 3. After restoring the conversation, the original prompt from the selected message is restored into the input field so you can re-send or edit it.
  38. **Keyboard**: both the candidate picker and the mode popover support ↑↓ to move, Enter to confirm, Esc to cancel/back.
  39. <details>
  40. <summary><b>Edge notes</b></summary>
  41. - **The withdrawn content is preserved** — it stays in the session log and can be inspected in the **Trajectory** panel; you can also disable the plugin to show it again (display only).
  42. - **A rewind cannot be undone in place** — to carry the content forward, first disable the plugin so the withdrawn content shows again, then click **Branch into a new conversation** on the message just before the rewind; the new conversation's context will include it.
  43. - **Interruptions rewind too** — a `steering` message the model hasn't read yet is also a valid rewind target, and withdrawing it does not interrupt the current run.
  44. - **Rewinding a read message interrupts the running turn** — to ensure the rewind runs safely.
  45. </details>
  46. ## Snapshot management
  47. As you work with dsh-rewind, checkpointing automatically captures the state of your code before each prompt you send that starts a turn. This creates the session's **snapshots** and saves them to `<dsh home>/rewind-snapshots/` (default: `~/.dsh/rewind-snapshots/`). The plugin keeps file snapshots for the 100 most recent checkpoints in a session. Discarding an older checkpoint deletes the snapshot files that no remaining checkpoint references.
  48. The **Snapshot backups** feature (on by default) controls checkpointing. It can be switched off in this plugin's configuration card. When off, no new snapshots are created; file changes made while off cannot be restored. Users who do not need file restore can avoid the extra copies and read/write overhead.
  49. The **Snapshot auto-cleanup** feature (off by default) deletes the snapshot directories of long-inactive sessions when enabled, once the session has been idle for about 30 days (by default). Configure and review it in this plugin's configuration card (the auto-cleanup switch and the idle-day cutoff). See [Snapshot auto-cleanup](docs/snapshot-auto-cleanup.md) for details.
  50. <img src="assets/screenshots/plugin-setting.png" alt="Plugin configuration card: snapshot backups and auto cleanup" width="600">
  51. ## Uninstall
  52. ```sh
  53. # Uninstall the plugin
  54. dsh plugin --profile <name> remove dsh-rewind-plugin
  55. # To also delete local data
  56. rm -rf <dsh home>/rewind-snapshots
  57. rm <dsh home>/snapshot-cleanup-last-sweep.json
  58. ```
  59. The plugin's configuration entries are stored in the current Profile's config file `cordis.patch.yml`. To clean up completely, delete the corresponding entries manually.
  60. ## What this plugin changes
  61. Compared with the default behavior:
  62. | Dimension | Default behavior | This plugin |
  63. | --- | --- | --- |
  64. | Conversation rewind | Branch into a new conversation | **In-place rewind** — no new session branch, no window switch, no leftover session copies |
  65. | File restore | Manual restore / Git management | **One-click restore** — quickly undo changes together with the conversation, fitting agent workflows |
  66. | Restore dependencies | Often needs a Git repository or a full snapshot engine | **None** — works in any directory |
  67. ## How it works
  68. The whole design rests on two principles, simple but deliberate: **the conversation half "masks, never deletes"**, using DSH's native "hide + replace" mechanism; **the file half "partial tracking + checkpointing"**, following Claude Code's checkpoint semantics.
  69. ### 1. Conversation rewind: a single "mask", not a delete
  70. `append-only` is a hard rule: the session log only grows and is never rewritten — the foundation of auditability and privacy. A rewind never touches history; it makes a single move: append **one "empty message" marker** to the end of the log and use it to "mask + replace" the target message and everything after it, so the model and the UI see only what came before it.
  71. - **One and the same log** — the append happens only in the current session's log: no new session, no new branch, so no residue or copy is left behind;
  72. - **The marker is canonical** — the same "hide + replace" as the official `/compact`: `/compact` compresses a span of history into a summary, while `/rewind` swaps in an "empty message" marker. Because it is canonical, DSH's log replay, compaction, and resume preflight all recognize it and never mistake it for a real message;
  73. - **The replacement is imperceptible** — the model ignores the marker, with no effect (verified empirically). Together with the plugin's UI handling, what you and the model see is exactly how the conversation looked at the target;
  74. - **Content is preserved** — because this is "masking, not deleting", the withdrawn content stays in the log — auditable, traceable, and in principle manually recoverable.
  75. > **Design note**: the entire conversation rewind is **a single append**. It's deterministic, auditable, and — because the log was never broken — a "clean" time-travel. Minimal action, complete semantics.
  76. ### 2. File restore: partial tracking and lightweight checkpointing
  77. The file half follows Claude Code's checkpoint semantics — **partial tracking + checkpointing**, not a whole-tree snapshot. This trade-off saves space while still covering changes to tracked files:
  78. - **Partial tracking**: tracks all changes made by DSH's file editing tools (`write`, `edit`) — records the files it first touches and backs up their pre-edit status; it never backs up the whole workspace, so it's lightweight.
  79. - **Checkpointing**: automatically captures the state of your **tracked files** before each prompt you send that starts a turn. External changes to tracked files such as a command run or a manual edit can be restored by a later rewind.
  80. - **Unchanged-not-stored**: when checkpointing, an unchanged file is never backed up; the same version from the previous checkpoint is reused instead of a copy.
  81. - **Accurate restore**: backups are the sole standard, checked against the real disk — **only files that actually differ are touched**. Backups are stored byte for byte, so the restored result matches the backups exactly, with no "ghost impact". Coverage is bounded by design: [File-rewind tracking boundary](docs/compat/tracking-boundary.md).
  82. - **Safety and integrity**: paths are sanitized so nothing ever escapes the backup root; symlinks / hard links are skipped so one restore can't clobber another name of the same file; a per-file failure never aborts the pass; checkpoints and versions are written atomically and kept across restarts, so a target file is never half-written; a crash can be rerun to converge.
  83. > **Design note**: **boundary checkpointing + first-touch capture + version reuse** — the message-boundary checkpoint re-reads every tracked file and records its state; first touch adds a new file with its pre-touch state; restore touches only files that differ. Small on disk and suitable for quick, session-level recoveries.
  84. ## Scope and division of labour
  85. This plugin deliberately stays lightweight and focused on one thing — "conversation rewind". The following are **out of its scope**, and each has a better owner (see [design boundaries](docs/boundaries.md)):
  86. - **Whole-tree snapshots** — checkpoints are for quick, session-level recovery, not a replacement for version control. For permanent version history and collaboration, continue using version control, such as Git, for commits, branches, and long-term history.
  87. - **Subagent edits** — not tracked, and no rewind inside a subagent session: a subagent runs its own session, so its backups could never be restored by a rewind of the parent session, and none are kept for one.
  88. - **Fork / branch rewind** — DSH already provides this ("branch in new chat"); no need to reinvent the wheel.
  89. ## Compatibility
  90. - Node.js `>=24.9.0`.
  91. - Supported DSH versions are declared by `package.json` `engines.dsh`.
  92. - Compatibility definition, verification method, and version alignment: see [docs/compat/audit.md](docs/compat/audit.md).
  93. > [!WARNING]
  94. > This project and DeepSeek Harness are both in developer preview. Pin exact versions in reproducible environments and review the behavior notes above.
  95. ## Known limitations
  96. 1. **Turn navigation keeps rewound turns** — the right-side turn navigation keeps an "unloaded" tick for each rewound turn, and hovering previews the withdrawn content. Only a display difference; no functional impact.
  97. 2. **A far rewind may show a blank transcript** — when the target predates the loaded history, the conversation area goes blank; click **Load earlier** to page back until the history appears.
  98. > [!NOTE]
  99. > Browser diagnostics are available; see [Browser diagnostics](docs/compat/diagnostics.md).
  100. ## Security
  101. This plugin only appends rewind-marker events to the session log; it never deletes or rewrites logged history. Workspace files are written only when you choose "conversation and files"; backups are stored under `<dsh home>/rewind-snapshots/`; restores draw only from those backups. It never touches your git repository, makes no network requests, and accesses no credentials. For sessions you've left inactive for a long time, a snapshot auto-cleanup (off by default) can remove their snapshot directory in whole, leaving the active session and the chat log untouched. Full security model: [docs/security-model.md](docs/security-model.md); to report a vulnerability, see [SECURITY.md](SECURITY.md).
  102. ## Development
  103. ```sh
  104. npm install # devDeps from the npm registry
  105. npm run check # one-shot full gate: typecheck + test + build + verify:host + pack --dry-run
  106. npm run typecheck # tsc on all three surfaces (host + client + client-test)
  107. npm test # vitest: all unit and compatibility suites
  108. npm run build # esbuild: lib/index.js (host ESM) + lib/client.js (loader closure) + .d.ts
  109. node scripts/verify-host.mjs # end-to-end verification of the built artifact
  110. ```
  111. `prepack` runs the full build, so `npm pack` / `npm publish` always ship a complete `lib/`. Install from npm or a packed tarball — a git checkout has no built `lib/`.
  112. Maintainers: the source layout and architecture are in [docs/architecture.md](docs/architecture.md); the harness interface reference is in [docs/harness-reference.md](docs/harness-reference.md).
  113. Contributing guide: [CONTRIBUTING.md](CONTRIBUTING.md).
  114. ## Release
  115. Releases go out through GitHub Actions Trusted Publishing (OIDC, no stored `NPM_TOKEN`): push a `v<version>` tag and CI publishes with Sigstore provenance.
  116. ```sh
  117. npm version patch && git push origin <branch> --tags
  118. ```
  119. One-time npm-side setup and the full workflow details: [docs/release/release.md](docs/release/release.md).
  120. ## License
  121. [MIT](LICENSE)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.