dsh-worktree-jump: Create a Git Worktree in New-Conversation and Start a Conversation

The session metadata (cwd) of DeepSeek Harness (DSH) is frozen at creation time, making it difficult to dynamically switch the working directory at runtime. The common practice is to manually fork a session, but this requires the user to execute a series of commands in the background.

The dsh-worktree-jump plugin encapsulates this workflow into the New-Conversation interface. It provides a trigger that lets you create a Git Worktree directly while selecting a workspace and forks the new session into that directory, enabling seamless context switching.

Plugin Overview

dsh-worktree-jump is a DeepSeek Harness (DSH) plugin. It uses a trigger to create a Git Worktree from a selected folder and starts the conversation directly in that Worktree.

  • Maintainer: frederico-kluser
  • Category: Workflow
  • License: MIT

Core Features

  1. New-Conversation trigger: A chip (🌿 New worktree) appears on the left side of the New-Conversation interface. Clicking it creates or selects a Worktree.
  2. Session fork mechanism: It leverages the meta.cwd override mechanism to point the forked session directory to the newly created Worktree while preserving the source session context.
  3. Existing Worktree support: In addition to creating a new Worktree, you can also directly select an existing Worktree and start a conversation in it.
  4. Localization: Supports English (default), Simplified Chinese, and Portuguese.
  5. Zero runtime dependencies: The plugin is a standalone ESM module and does not require additional runtime libraries.
  6. Name validation: Supports filesystem-safe name validation for 1-64 characters.
  7. Automatic exclusion: Automatically excludes the Worktree root directory via .git/info/exclude.

Installation and Activation

The plugin uses the Bundle installation method. After installing, you need to restart dsh web to see the effect.

dsh plugin --profile web add github:frederico-kluser/dsh-worktree-jump

Note:
* This plugin depends on DSH cordis version >=4.0.0 <5.
* Important: If you install using Bundle, do not manually add a - insert: line in the configuration file. Bundle installation and manual Patch insertion use the same loader entry ID (worktree-jump); enabling both will cause a conflict.
* The plugin is pure ESM with no build dependencies.

Typical Usage

In the New-Conversation interface, the plugin shows a chip on the left side of the “Select Workspace” selector.

  1. Click the 🌿 New worktree chip.
  2. Enter a Worktree name in the dialog that appears (for example, my-feature).
  3. After confirming, the session starts in the <repo>/.worktrees/<name> directory.
  4. If you already have existing Worktrees, the dialog shows a list of buttons. Clicking one takes you directly into that directory without creating a new one.

Notes

  • Single activation path: Do not use Bundle installation and manual Patch injection at the same time. Both point to the worktree-jump entry and will cause a duplicate loader entry id error at startup.
  • Session behavior: Forking preserves the full history of the source session if it is an existing session, or starts as a completely new blank session if the source is blank. The original session remains unchanged.
  • Filesystem permissions: The plugin runs with the permissions of the DSH process. Ensure that you have permission to run Git commands in the target repository directory.

Summary

dsh-worktree-jump solves the cumbersome problem of switching development context in DSH. By combining Worktree creation and session forking into a single operation, developers can quickly enter a new branch for development or testing without leaving the UI.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye