Getting Started
worktree streamlines common Git worktree tasks into a repeatable workflow.
Install
Install globally:
npm
npm install -g @northguild/worktreeOr run directly without global install:
npm
npx @northguild/worktree —helpAgent skill
To teach a coding agent how to drive worktree, including its --json agent mode, add the usage skill:
npx skills add northguild/worktree —skill worktreeAt a terminal the command asks which agent(s) to install the skill into; run from inside a coding agent it installs without asking, and --agent <name> chooses. It installs into the current project; add --global (-g) to install it for your user instead, so the agent has it in every repository. It is separate from, and in addition to, the install above: the skill teaches an agent the CLI, it does not install the CLI.
Initial Configuration
Run once inside your repository:
worktree configCommon values:
defaultSourceBranch: usuallyorigin/maincodeEditor: usuallycodeagent.command: optional, such asclaude --bg, the command--agentruns to hand a brief to a coding agent
To open worktrees as Herdr spaces instead of editor windows, set
opener to herdr — see Herdr Spaces. Set it to none to open nothing:
branch prints Worktree created at <path> and stops.
First Workflow
Create your first branch worktree:
worktree branch feature/improve-readmeThis command will:
- Branch from your configured source branch.
- Create a worktree under
<repo>.worktrees/feature/improve-readme. - Copy the gitignored env files from your main repository —
.env*,.dev.vars*and.envrc. - Open the new worktree in your configured editor, or as a Herdr space when
openerisherdr.
Requirements
- Git available on your
PATH - Node.js installed
- Existing Git repository
- macOS or Linux — Windows is not supported
If you use automatic editor opening, ensure your editor command is available on your PATH (for example, code).