DeepSeek Harness (DSH)’s built-in conversation forking feature can copy the dialogue history, but by default it does not synchronize the corresponding workspace file state. In scenarios where development or debugging needs to continue from a specific turn, this can lead to state fragmentation. The dsh-workspace-snapshot-fork plugin extends DSH’s forking mechanism to bring the file snapshot associated with a turn into the new session, while keeping the source workspace unchanged.

The plugin is maintained by Yu-Zhuang1 and licensed under the MIT license. It uses Git objects as the storage backend and generates immutable checkpoints for each completed turn.

How It Works

For each completed turn, DSH generates an immutable, Git-based checkpoint. When you fork that turn in the Web UI, the plugin copies the conversation log prefix and materializes matching files in a new workspace.

The exact behavior depends on the type of the source workspace:

  • Plain directory: The checkpoint is materialized from a private snapshot repository.
  • Git repository root (with commits): A new worktree and dsh/workspace-fork/<id> branch are created, preserving history, remotes, hooks, and repository configuration.
  • Nested directory or a Git repository without commits: The private snapshot behavior is used.

Installation and Enabling

This plugin currently supports only the Web profile. The installation command is as follows:

dsh plugin --profile web add "github:Yu-Zhuang1/dsh-workspace-snapshot-fork#v0.1.0-alpha.1"

DSH must be restarted after installation or update.

Configuration

The default configuration keys are located in cordis.patch.yml:

mode: workspace
storageRoot: <DSH_HOME>/workspace-snapshot-fork/snapshots
childRoot: <DSH_HOME>/workspace-snapshot-fork/workspaces
exclude: [.git, node_modules, .env, .env.*, .DS_Store]

DSH_HOME defaults to ~/.dsh. To override the configuration, edit $DSH_HOME/profiles/web/cordis.patch.yml and provide the full configuration. Note: DSH replaces the entire config value rather than merging fields, so all configuration items must be preserved when overriding.

Native Mode

Set mode: native in the full configuration to delegate new forks to DSH’s native behavior. Native mode does not record new workspace checkpoints, but archival cleanup still releases existing checkpoints. After switching back to workspace mode, only subsequently completed turns generate checkpoints.

Cleanup and Maintenance

Child worktrees, branches, and snapshots created by forking are not deleted automatically. The manual cleanup commands are as follows:

git -C <source-repository> worktree remove <child-workspace>
git -C <source-repository> branch --delete dsh/workspace-fork/<id>

Notes

  • Platform support: Currently, only Windows support has been tested (Web profile). Linux and macOS have not been verified.
  • Version compatibility: Supports the DSH 0.1.1-rc.x series. DeepSeek Harness is in developer preview, so the plugin should be verified after upgrades.
  • Security: Snapshots are local Git objects and are not encrypted. The plugin does not treat .gitignore as a security policy; sensitive file paths (such as .env) must be manually added to exclude.
  • Limitations: There is no headless fork adapter. Archived sessions remove checkpoint mappings. Checkpoints are created only under mode: workspace.
  • GitHub: https://github.com/Yu-Zhuang1/dsh-workspace-snapshot-fork
  • Plugin directory: https://www.skillhub.cn/plugins/Yu-Zhuang1/dsh-workspace-snapshot-fork