dsh-tauri-worktree creates a separate Git directory for each worktree session so Agent
changes do not directly affect the local main workspace.

Workflow
1
Request a worktree
The Agent may call
create_worktree only after the user requests isolated work.2
Create an isolated session
The plugin creates
~/.dsh/worktrees/[hash]/[dirname] and hands the session to it.3
Change and verify
The Agent edits, tests, and commits inside the isolated directory.
4
Check out or discard
After explicit approval, check the work back to a local branch, or discard it when it is not needed.
Staged changes
create_worktree and checkout_worktree support carry_staged, default false. When enabled,
only changes staged in the Git index move across. Unstaged and untracked files do not. The
implementation uses binary diff/apply and does not use the repository’s shared stash.
Authorization boundary
The project must be a Git repository and the host must be able to rungit. If carrying or
checking out changes fails, the plugin prefers preserving the worktree and recovery context
over silently losing changes.
View source