Create worktree
hwt create turns a branch into a ready Herdr workspace.
hwt create --branch BRANCH [flags]What happens
Section titled “What happens”- hwt resolves the repository and merged global and project configuration.
- Herdr creates the linked Git worktree, workspace, and root pane.
- hwt copies, clones, or links configured files into the checkout.
- Post-create commands run in order.
- hwt records the base branch and returns the workspace details.
If file setup or a post-create command fails, hwt asks Herdr to remove the partially created worktree.
| Flag | Description |
|---|---|
-b, --branch BRANCH |
Branch to create. Required. |
--base REF |
Base ref. Defaults to the current branch. |
--cwd PATH |
Repository path. Defaults to the current directory. |
--path PATH |
Override the configured worktree path. |
--label LABEL |
Herdr workspace label. |
--focus |
Focus the new workspace. |
--json |
Print machine-readable output. |
Examples
Section titled “Examples”Create from the current branch without changing focus:
hwt create --branch feat/agent-statusCreate from main, focus the new workspace, and return structured output:
hwt create --branch feat/agent-status --base main --focus --jsonThe JSON result includes the workspace ID, root pane ID, checkout path, branch, base ref, configured agent, copied paths, and configuration sources.