Skip to content

paradoxSCH/dsh-worktree

30Last commit Aug 15, 2026

dsh-worktree DSH plugin

dsh-worktree provides isolated Git worktrees for DSH sub-agents, allowing parallel tasks to work in independent checkouts. After task completion, results can be reviewed, validated, committed, handed off, merged, archived, or restored, all without directly affecting the main working directory.

How to install the dsh-worktree DSH plugin

dsh plugin --profile web add @paradoxsch/dsh-worktree@alpha

Copying does not run this command. Review the repository and version before installing the dsh-worktree DSH plugin.

dsh-worktree DSH plugin data source

dsh-worktree DSH plugin snapshot date: Aug 16, 2026

discovered

What the dsh-worktree DSH plugin can do

  • Three task start modes (working-state, head, fresh) to control which changes are inherited by the sub-agent.
  • Three retention modes (ephemeral, managed, permanent) to decide whether worktrees are automatically cleaned or preserved.
  • Full lifecycle management via /worktree command: list, create, review, validate, commit, branch, handoff, merge, push, pr, archive, restore, discard.
  • Safety checks: modifications are never automatically discarded; operations re-check worktree state before execution.
  • Integration with DSH job system: supports background sub-agent tasks with run_in_background: true and job_output/job_kill.

Where the dsh-worktree DSH plugin fits

  • Run multiple sub-agent tasks in parallel, each in its own isolated worktree.
  • Review and validate sub-agent changes before merging them into the main branch.
  • Experiment with risky modifications in a temporary worktree, then discard or archive results.
  • Deliver incremental changes from a sub-agent to the current session checkout without disrupting ongoing work.
  • Create Pull Requests from worktree branches using GitHub CLI.

Who the dsh-worktree DSH plugin is for

  • Developers using DSH who need to manage multiple concurrent tasks or changes.
  • Teams that require isolated environments for sub-agent operations to prevent workspace conflicts.

dsh-worktree DSH plugin limitations

  • Current alpha version supports only DSH 0.1.0-rc.6 and subsequent 0.1.x releases.
  • Creating Pull Requests requires a logged-in GitHub CLI (gh) – without it, PR operations are unavailable.
  • Sensitive files like .env, keys, and certificates are not copied into worktrees; they must be provided via DSH credentials or environment.
  • Force push is not used; push and merge operations require clean and safe conditions.

dsh-worktree DSH plugin: from the repository README

Quoted from the paradoxSCH/dsh-worktree README, the upstream source of the dsh-worktree DSH plugin. Copyright remains with the original authors.

为 DeepSeek Harness(DSH)子代理提供隔离的 Git worktree。并行任务在独立 checkout 中工作,不直接修改主工作区;任务结束后可以审阅、验证、提交、交付、归档或恢复结果。 > [!IMPORTANT] > 当前 alpha 版本支持已发布的 DSH `0.1.0-rc.6` 及后续 `0.1.x` 版本。 ## 安装 插件安装到全局 DSH profile,不会修改业务项目的 `package.json`。 Web profile: ```sh dsh plugin --profile web add @paradoxsch/dsh-worktree@alpha ``` Headless profile: ```sh dsh plugin --profile headless add @paradoxsch/dsh-worktree@alpha ``` 检查是否安装成功: ```sh dsh plugin --profile web why @paradoxsch/dsh-worktree dsh --profile web --dump-config ``` ## 第一次使用 让 Agent 使用 `subagent_worktree` 委派任务,子代理会自动进入独立 worktree。Web profile 的侧边栏底部会出现 **Worktrees**,可以在其中查看状态、diff 和可用操作。 委派默认等待子代理返回结果;需要并行执行时可以设置 `run_in_background: true`,之后通过 DSH 的 `job_output` 查看结果、通过 `job_kill` 停止任务。每次委派都是独立子任务。 也可以使用 `/worktree` 命令手动管理: ```text /worktree list /worktree create working-state managed /worktree review <id> /worktree validate <id> /worktree doctor ``` 不带子命令的 `/worktree` 等同于 `/worktree list`。`<id>` 来自 list/create 的返回结果。 ## 选择任务起点 | 模式 | 子代理从哪里开始 | 适合场景 | | --- | --- | --- | | `working-state` | 当前 HEAD,加上 staged、unstaged 和非 ignored 的 untracked 变更 | 继续当前正在进行的工作;默认值 | | `head` | 当前已提交的 HEAD | 不希望继承未提交修改 | | `fresh` | 远端最新基线 | 与本地当前分支无关的

Read the full READMERepository license: MIT

dsh-worktree DSH plugin questions

How do I install dsh-worktree?

Use the command `dsh plugin --profile web add @paradoxsch/dsh-worktree@alpha` for the web profile, or `--profile headless` for headless. Verify with `dsh plugin --profile web why @paradoxsch/dsh-worktree` or check the config dump.

What task start modes are available?

Three modes: working-state (default, includes staged, unstaged, and non-ignored untracked changes), head (only committed HEAD), and fresh (latest remote baseline). Choose based on whether you want to inherit uncommitted modifications.

How do I manage worktrees?

Use the `/worktree` command with subcommands like list, create, review, validate, doctor. You can also delegate tasks to sub-agents using `subagent_worktree`, which automatically creates an isolated worktree.

How do I create a Pull Request from a worktree?

Use `/worktree pr <id> <title>`. This requires GitHub CLI (`gh`) to be installed and logged in (check with `gh auth status`). If gh is not available, you can still commit, branch, handoff, merge, and archive locally.

What happens to worktrees when a task ends?

It depends on the retention mode: ephemeral removes clean checkouts automatically, managed keeps modifications for review, and permanent retains until explicitly handled. Modifications are never automatically discarded; you must use discard or archive to clean up.