Foreword¶
DSH (DeepSeek Harness) adopts a plugin-based architecture, allowing users to extend functionality as needed. When developing in the Web UI, managing multiple Git branches or Worktrees often requires frequently switching terminals or leaving the browser. dsh-plugin-worktree addresses this pain point by introducing Claude Code-style Git Worktree support into the dsh Web UI, allowing users to create, switch, and delete Worktrees directly in the browser.
What Is It¶
This is a DSH plugin maintained by limoiie. Its core purpose is to provide Worktree management capabilities in the dsh Web UI, so workspace switching no longer depends on the command line.
Core Features¶
The plugin adds the following interactive capabilities to the Web UI:
- New-session hero: On the new session page, the Workspace chip displays the root workspace name; the Worktree chip displays the current Worktree name and provides entries to list repository Worktrees, create a new Worktree, and switch to another Worktree.
- Sidebar badge: The workspace title in the sidebar is accompanied by a
⑂branch badge, distinguishing regular workspaces from Worktree workspaces. - Delete dialog: When deleting a Worktree workspace, a dialog asks whether to also delete the corresponding Git Worktree directory and its
dsh/<name>branch, or only remove the DSH session registration.
Installation and Enablement¶
Before using it, ensure the environment meets the following requirements:
* dsh is installed and running properly.
* The web profile is configured (i.e., using dsh web).
* git is installed on the machine.
* Node.js version is 18 or higher.
Installation command:
dsh plugin --profile web add dsh-plugin-worktree
After installation, restart dsh web for the change to take effect.
Configuration¶
The plugin provides two configuration options with the following default values:
| Field | Default | Description |
|---|---|---|
root |
process.cwd() |
Directory used for git rev-parse --show-toplevel |
worktreesDir |
.dsh/worktrees |
Worktree root directory; supports absolute paths or paths relative to the repository root |
Users can modify these values by overriding id: worktree in cordis.patch.yml.
Usage¶
- Create a Worktree: Open a new session, expand the Worktree chip in the Workspace Picker, click New worktree…, enter a name (such as
feat/okta-sso), and confirm. - Switch Worktree: Open a new session again and select an existing Worktree workspace from the Worktree chip or the sidebar to enter it.
- Delete a Worktree: Find the corresponding workspace in the sidebar and use the deletion flow. The system will ask whether to remove the Git Worktree directory and branch; choose to keep or delete as needed.
Notes¶
- Security: Worktree names are validated to prevent path traversal attacks and invalid Git names (maximum length of 64 characters; only letters, digits, dots, underscores, and hyphens are allowed).
- Branch deletion limitation: Branch deletion uses the
git branch -dcommand. If the branch contains unmerged commits, Git will refuse to delete it, and the client will prompt “branch kept”. - Directory cleanup: The configured Worktrees directory is added to
.git/info/excludeon a best-effort basis to keep the main checkout directory clean.
Summary¶
dsh-plugin-worktree provides native Worktree management capabilities for DSH Web users. By operating directly in the browser, developers can more conveniently manage parallel development environments. Plugin URL: https://github.com/limoiie/dsh-plugin-worktree