Foreword¶
When running coding tasks in DSH, a common issue is that the Agent directly modifies the Local checkout: task increments can easily get mixed with existing staged, unstaged, and untracked content; multiple tasks may also contend for the same checkout.
dsh-git-worktree addresses this by separating “construction” from “delivery”: the Agent works and tests in an isolated Worktree, the user first reviews a reversible Local Preview, and only after confirmation does the Host save the current task’s increments.
What This Is¶
wloops/dsh-git-worktree is an experimental Session Target plugin for DeepSeek Harness, maintained by wloops and released under the MIT license.
In one sentence: it allows the Agent to execute tasks in a real Git Worktree, preview changes first, and then have the user explicitly confirm whether to save.
It is an independently maintained community plugin, not an official DeepSeek project, and does not represent official endorsement, collaboration, or authorization. Its current positioning is a project-level Worktree Session delivery plugin, not a cross-project global Worktree Manager.
Core Features¶
- Each task has its own isolated Git Worktree, Workspace, and a unique owner Session.
- The Agent only modifies and tests within the isolated Worktree.
- The user first reviews a reversible Local Preview.
- The Host only saves the current task’s increments, without absorbing unrelated Local changes.
- When safety cannot be proven, writes stop and recovery evidence is preserved.
- Managed owner sessions are directly attributed to the original Local project via Branch Icons and status Badges; normal Local Sessions retain official behavior.
- After Ready, the user can choose “Preview Changes,” “Confirm and Save,” or other actions.
- Preview writes to Local but does not immediately create a Commit and can be safely reverted.
- Final delivery creates only one Commit for the accumulated increments of this round.
- Checkpoints exist only in the managed Worktree and are ultimately merged into a single delivery.
- Handles Local drift, conflicts,
preview_detached, restarts, and cleanup interruptions. - Multiple Worktrees can operate in parallel, but the same Local project accepts only one Preview at a time.
- After delivery and cleanup, the next round can begin in the original Session and conversation.
Installation and Activation¶
Requirements¶
- Node.js
^22.19.0 || >=24.0.0 - DeepSeek Harness
0.1.1-rc.2package line - Harness Web Client
- Git Workspace
Installation¶
The following command installs the plugin under the web profile:
dsh plugin --profile web add dsh-git-worktree
To use a specific version:
dsh plugin --profile web add github:wloops/dsh-git-worktree#v0.7.1
Activation¶
After installation, open Git Workspace and enable Worktree when creating a new Session.
Existing Local Sessions can also ask the model to call worktree_create to create an isolated Session.
For first-time use, it is recommended to complete a full flow:
Create → Preview Changes → Confirm and Save → Cleanup
Typical Usage¶
How to Choose During Acceptance¶
Select actions based on your goal:
| Goal | Action |
|---|---|
| First check the effect locally | Preview Changes |
| Preview looks good | Confirm and Save |
| Long task, save progress first | Save Stage and Continue |
| Still need the Agent to modify code | Continue Editing or Revert This Preview |
| No Preview needed | Skip Preview and Save |
Key behaviors are as follows:
- “Preview Changes” writes to Local but does not immediately create a Commit and can be safely reverted.
- “Confirm and Save” ultimately creates only one Commit for the accumulated increments of this round.
- “Save Stage and Continue” saves a Checkpoint in the managed Worktree and is ultimately merged into a single delivery.
Local Development¶
If you want to participate in plugin development, install dependencies and run checks with the following commands:
pnpm install
pnpm run typecheck
pnpm test
pnpm run build
pnpm run check:publish
End-to-end startup:
pnpm run dev:dsh
Safety Boundaries and Current Limitations¶
- All Local writes are re-checked by the Host before execution; browser cache and model output do not constitute write authorization.
- The plugin validates Session, checkout, revision, Git identity, Preview receipt, and Local status; it fails closed on branch switches, overlapping conflicts, unknown residuals, or insufficient recovery evidence.
- If the owner is missing, extra Sessions exist, or ownership conflicts arise, the original Workspace is preserved to avoid silently hiding data.
- Worktree-aware Fork is not yet implemented; this version does not show the normal Fork entry.
- Child Agents inherit the parent Session’s cwd; the plugin does not create additional per-child Worktrees.
- Checkpoints do not support historical editing, deletion, reordering, or arbitrary rollback.
- Domi’s global Manager, Local Maintenance, dependency snapshots, and full collaborator lifecycle are outside this plugin’s scope.
Suitable Scenarios and Notes¶
Suitable for these use cases:
- You want the Agent to modify and test first without directly polluting the Local checkout.
- You want to review a reversible preview in Local before deciding whether to save.
- You need to save this round’s task increments as a single delivery rather than mixing them with other local changes.
- You want multiple Worktrees to operate in parallel, but the same Local project accepts only one Preview at a time.
Before using, note:
- The plugin runs with the current dsh process permissions; review the source code and license before installation.
- It is an independent community plugin, not an official DeepSeek project, and does not represent official endorsement, collaboration, or authorization.
- The community directory page provides plugin information but is not equivalent to an official app store.
Closing¶
The core value of dsh-git-worktree is transforming the Agent’s local modifications from “directly writing to disk” into “isolated construction, manual preview, and confirmed delivery.” If you want to control the boundaries of Agent modifications to Local in DSH, it provides a practical workflow solution.
Directory page:
https://www.skillhub.cn/plugins/wloops/dsh-git-worktree
GitHub: