Taler97/dsh-rollback

Observational file-mutation rollback for the fs tools: write/edit pre-images are checkpointed as git blobs or snapshots and restored through a model-facing rollback_files tool or a /rollback command.

dsh-rollback is file-mutation rollback for DeepSeek Harness: it checkpoints the pre-image a write/edit mutation reports in its result, forward-snapshots the workspace around black-box bash/run_code calls so the files they change are diffable, retains every pre-image in the workspace git object database or a snapshot store, and exposes restore through a model-facing rollback_files tool and a /rollback human command. /rollback undoes the single most recent captured mutation in the session's working directory; /rollback 3 undoes the three most recent; rollback_files {count} lets the model undo its own write/edit mistakes. It registers no service and changes no loop code — capture rides the documented tools/* extension points, and restore writes files directly (never through the fs policy seam or sandbox, because undoing a mutation must not be gated by the policy the mutation passed). Mutations through str_replace_editor, raw subprocesses, or bash outside a git repository carry no recoverable pre-image and are not captured; a session can only restore records at or under its own working directory.

Tools & Capabilities ★ 1 updated 2026-08-17
View on GitHub ↗

Install

dsh plugin --profile web add dsh-rollback

npm dsh-rollback 0.1.1 verified 2026-09-02 (repository field → github.com/Taler97/dsh-rollback; README bilingual EN/zh). Install from npm (recommended): dsh plugin --profile web add dsh-rollback (README's demo profile is any name — install into the profile you use); other sources: a pinned git commit (github:you/dsh-rollback#<sha> — sources are built by the prepare script) or a local tarball. Prerequisites: a dsh CLI on the machine (dsh plugin shells out to pnpm, so pnpm must be on PATH). The package declares dsh.bundle, so the reconciler adds it to the profile automatically.

Compatibility

DSH profile with the tools/result observation event and tools/execute around hook (base profiles provide them); workspace git repository for bash/run_code snapshot capture.

Details

Recent updates

write/edit pre-image checkpoints; forward snapshots around bash/run_code; rollback_files tool + /rollback command; git-object-db or snapshot store; direct restore writes; no loop-code changes.

FAQ

How do I undo a file overwrite?
Type /rollback (undoes the most recent captured mutation in this session's working directory, or /rollback 3 for three), or tell the model to restore it — it calls the rollback_files tool.
What mutations are captured?
Successful write/edit results that carry a before pre-image, plus file changes made by bash/run_code calls in git repositories (forward-snapshotted then diffed); str_replace_editor, raw subprocesses and non-git bash have no recoverable pre-image.
Why does restore bypass the fs policy?
Undoing a mutation must not be gated by the policy the mutation already passed, so restore writes files directly — the plugin never routes through the fs policy seam or the sandbox.

More plugins in Tools & Capabilities

Browse more in Tools & Capabilities

Guides for Tools & Capabilities plugins