Introduction

When programming with DeepSeek Harness (DSH), the agent continuously edits files in the workspace. If the conversation is partway through, the agent has taken a wrong turn, and you want to roll back to an earlier state, the existing DSH mechanisms usually cannot satisfy that: the session log is append-only and cannot be rolled back, while the user’s local Git repository may be in an uncommitted state or may not have been initialized at all. Running git checkout directly will discard all current uncommitted changes, causing valid work to be lost.

The DeepSeek Harness Rewind plugin is designed to address this pain point. By storing snapshots in its own shadow repository, it provides a “time travel” capability for each conversation turn, allowing you to restore the workspace to any previous state at any time, without ever touching your own Git repository.

Plugin Scope

This is a DeepSeek Harness (DSH) plugin. Its core responsibility is to automatically save workspace snapshots and allow the file system to be restored to any point in history. The plugin maintainer is zoyluoblue, and its license is MIT.

Installation and Enablement

Installing the plugin requires running the following command in a terminal. The command adds it as a plugin to your DSH configuration.

npx -y @deepseek-ai/dsh plugin --profile web add @zoytown/dsh-rewind

After installation, restart the dsh process. After restarting, a Rewind entry appears in the sidebar of the Settings page.

Prerequisite: git must be installed on the machine. If git is not installed, the plugin reports that snapshotting is suspended, but other features are not affected.

Basic Usage

The plugin provides both a command-line interface and a graphical interface for managing snapshots.

Command-Line Operations

The following commands are handled locally by DSH, do not consume tokens, and are not sent to the model.

Command Description
/rewind Restore the state from the previous turn
/rewind 3 Restore the state at the end of turn 3
/rewind a1b2c3d4 Restore a snapshot by ID (the ID is a unique prefix of at least four characters)
/rewind list List all snapshots for the current workspace
/rewind save Manually save the current state outside a conversation turn

Note: A restore operation prints the ID of the snapshot that it overwrites. You can use that ID to run the restore command again and undo this rollback.

Graphical Interface Operations

Go to Settings -> Rewind. The list displays all snapshots in reverse chronological order, showing which files were changed and which tools were run for each snapshot. Click the Restore button to restore it; the system displays a confirmation dialog that explicitly states which new files will be deleted.

How It Works and Configuration

Storage Mechanism

The plugin does not modify your local .git repository. All snapshots are stored in a shadow repository under the $DSH_HOME/rewind/ directory. This means the plugin works even if your project directory is not a Git repository or if .gitignore is not configured, and it provides the same level of protection as a Git repository.

File Filtering

The plugin strictly respects the .gitignore configuration. Ignored files (such as .env, node_modules, build outputs, etc.) are neither saved nor restored. This helps keep the snapshot repository small and ensures that these files remain unchanged after a restore.

Reversibility

Every restore operation is reversible. The plugin saves the overwritten state before overwriting files, so if you want to undo an incorrect restore, simply restore the previous state again.

Agent Access Control

By default, the plugin is disabled for agents. You can set exposeTool in the configuration file to control whether agents can use the rewind functionality.

  • 'off': The default value; rewind functionality is limited to human operation.
  • 'read-only': Allows agents to view the history list (rewind_list) but not to restore files.
  • 'full': Allows agents to restore workspace files (rewind_restore).

Cleanup and Maintenance

Snapshot data exists independently of the plugin itself. If you want to free up disk space, you can delete the $DSH_HOME/rewind/ directory directly.

The plugin automatically cleans up old sessions. The default retention period is 30 days: if the most recent snapshot in a session has not been updated for more than 30 days, that session is automatically discarded. In addition, the .git directory itself is always excluded from snapshots.