Introduction¶
When using DeepSeek Harness (DSH) to let an Agent modify code, conversations can be undone, but the workspace files already written to disk do not automatically roll back. If you rely on Git, uncommitted drafts, ignored files, or uninitialized directories often fall outside the scope of regular version control. The following introduces the community plugin dsh-time-machine (Maintainer: zjukop, Category: Workflow): It establishes content-addressed snapshots for the workspace locally, compares changes, and restores only after explicit user confirmation.
What is this¶
dsh-time-machine is an npm plugin for DeepSeek Harness (current package version 0.1.0, License MIT). Its positioning is “Safe, local workspace checkpoints and two-phase restore for DeepSeek Harness”—local-first workspace checkpoints and a deliberately two-phase restoration process. It does not replace Git; it has no branching, remote synchronization, or garbage collection. It is suitable for keeping a locally inspectable and revertible archive before the Agent makes significant changes.
Core Functions¶
Snapshot and Comparison¶
time_machine_checkpoint: Create an archive.time_machine_list: View existing archives.time_machine_diff: Read-only comparison between the current workspace and a specified archive.
Data is stored by default in .dsh-time-machine/ under the workspace. By default, .git, node_modules, .DS_Store, storage directories, and symbolic links are ignored. The default single-file size limit is 10 MiB, and the default single archive size limit is 200 MiB (subject to plugin documentation).
Two-Phase Restoration¶
Restoration is designed as a two-phase process to reduce the risk of accidental overwriting:
time_machine_restore_preview: Read-only preview that returns a short-lived, one-time token bound to the snapshot and restore mode.time_machine_restore: Executes the restoration with a valid token. Missing, expired, reused, or mode-mismatched tokens will be rejected.
Restore modes:
merge(default): Restore files from the checkpoint while preserving files added after the checkpoint.exact: In addition to restoring checkpoint files, it deletes files added after the checkpoint. This must be explicitly selected during the preview, and a confirmation token bound to this mode must be used.
The preview phase displays the count of added, modified, and deleted files relative to the archive, facilitating the assessment of the impact scope before actually writing to disk.
Installation and Activation¶
DSH plugin management invokes pnpm. Please ensure that pnpm --version runs normally on your local machine before installation. The plugin requires Node.js >= 22.
Install under the web profile:
npx @deepseek-ai/dsh plugin --profile web add dsh-time-machine
Restart dsh web after installation. If doing local development in the plugin source directory, you can set the current directory as the installation target:
npx @deepseek-ai/dsh plugin --profile web add .
Typical Usage¶
In a conversation, you can first create a checkpoint, then diff, then preview, and finally restore only with explicit user consent. The example phrasing provided in the official documentation is as follows:
Before refactoring the login module, please archive the workspace named "Pre-login refactoring".
Show what has changed between the current workspace and "Pre-login refactoring".
Preview the return to "Pre-login refactoring", but do not actually restore yet.
Corresponding toolchain: time_machine_checkpoint → time_machine_diff → time_machine_restore_preview; The Agent should only call time_machine_restore after the user has viewed the preview and explicitly agreed.
Use Cases and Notes¶
Who it is for: Developers who frequently let Agents perform significant refactoring or batch file modifications in DSH web and wish to keep local snapshots before changes; especially in scenarios where it is inconvenient to use or Git does not cover all files.
Runtime and Trust Boundary: The plugin reads and writes to the workspace with the permissions of the current DSH process. Before installation, you should read the source code and MIT License on the GitHub repository and assess whether to include it in your workflow.
Ecosystem Description: DeepSeek Harness adopts an “everything is a plugin” extension approach. The community catalog entry dsh-time-machine page on SkillHub is an independent site collection and has no official affiliation with DeepSeek / High-Flyer.
API Stability: The documentation notes that DSH APIs in the Developer Preview phase may undergo breaking changes. The plugin is developed according to the official tool registration contract and has undergone independent build verification with the published npm package @deepseek-ai/dsh-tools@0.0.1-rc.1.
Conclusion¶
Through the steps above, you can lock the workspace state with local snapshots before the Agent starts working, see clearly “which files will be affected” using diff and preview, and then return to the checkpoint using token-bound two-phase restoration. For more details, see the repository README.zh-CN.md; Catalog page: https://www.skillhub.cn/plugins/zjukop/dsh-time-machine, Source code: https://github.com/zjukop/dsh-time-machine.