Introduction¶
The design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” In local development and agent collaboration, managing multiple branches and session contexts often requires frequently switching working directories, which can interrupt the continuity of a session. The dsh-worktree plugin integrates Git worktree management into the DSH Web client to solve this problem. It allows sessions to run in isolated branch environments without manually managing folders.
What Is This¶
This plugin is maintained by navid-kianfar and is designed to provide branch and worktree switching functionality for the DeepSeek Harness Web client. It uses Git worktrees directly as Harness workspaces, allowing new sessions to generate new branches and create worktrees based on messages, or to switch, manage branches and worktrees in active sessions.
Core Features¶
This plugin provides the following core capabilities:
- New Session Toolbar Integration: In the new session interface, a project switcher, mode chips, and a branch capsule are added above the editor. The branch capsule includes a “Worktree” checkbox, which controls whether the current session runs based on a worktree.
- Worktree Mode and Session Creation: After checking the Worktree checkbox, when the first message is sent, the system generates a new branch name based on the message content (or uses the message slug if the model is unavailable), creates a new Git worktree at the specified path, and registers the worktree as a Harness workspace.
- Branch and Worktree Management: In an active session, the current branch status (ahead/behind), uncommitted changes (dot), and worktree count are displayed above the editor. It supports switching, creating, renaming, and deleting branches, as well as opening, locking/unlocking, and deleting worktrees.
- Git Command Integration: It provides the “Fetch and prune remotes” and “Prune stale records” features, which execute
git fetch --all --pruneandgit worktree prune, respectively.
Installation and Enablement¶
This plugin depends on the following environment:
- DeepSeek Harness: version 0.1.5-rc.2 (web profile).
- Git: Git 2.23+ installed on the host (2.36+ is used for displaying locked/prunable flags).
- pnpm: pnpm needs to be installed on the host.
For installation and enablement, refer to the plugin directory or the official source installation guide.
Typical Usage¶
- Create a New Worktree-Based Session: In the new session interface, check the “Worktree” checkbox in the branch capsule. Select a base branch, enter a message, and send it. The system will automatically generate a branch name, create a worktree, and run the session within it.
- Manage Branches and Worktrees: In a running session, branch and worktree status is displayed above the editor. Click the capsule to switch branches, create a new worktree, or perform prune operations.
- Execute Git Commands: In the branch or worktree pop-up, you can use the “Fetch and prune remotes” or “Prune stale records” commands to clean up remote and stale records.
Applicable Scenarios and Notes¶
- Applicable Scenarios: Suitable for developers who need to maintain independent branch environments for different tasks, perform experimental development, or handle parallel work while keeping the main repository clean.
- Notes:
- The browser does not run Git commands directly; all operations are executed through the host process.
- Deleting a worktree does not automatically deregister the workspace; you need to remove it manually from the sidebar.
- This plugin is licensed under MIT. Please check the source code before using it.
Summary¶
By deeply integrating the Git worktree mechanism with DSH session management, this plugin enables session isolation and switching between branch environments. For developers who need multi-branch collaboration locally, it provides a more intuitive and efficient workflow.
- Plugin directory: navid-kianfar/dsh-worktree
- Source code address: navid-kianfar/dsh-worktree