using-worktrunk
Skill4 starsChanged 21 days agoMITView on GitHub
Creates, finds and removes git worktrees with worktrunk (`wt`) instead of `git worktree add`, the built-in worktree tools or ad-hoc directories. Use whenever the task needs a separate checkout or a worktree, for example to work on another branch in parallel, to isolate an experiment, to review a PR or to run a subagent on its own branch, even if the user does not say worktrunk.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .copilot/copilot-instructions.mdCopilot instructions
- acting-as-diegoferigoSkill
- creating-skillsSkill
- gh-stackSkill
- guide-me-throughSkill
- opening-hunkSkill
- opening-zedSkill
- orchestrating-agentsSkill
- working-in-zedSkill
- working-on-dotfilesSkill
- code-reviewSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Create a worktree only when the task needs one.
- Very specific: line 21
Use the usual branch prefix of the repository (for example diegoferigo/<topic>).
- Very specific: line 22
Do not pass --no-hooks: the hooks are the point.
- Very specific: line 32
Check wt list before creating one and reuse the existing worktree of a branch.
- Very specific: line 40
Remove only worktrees you created in this task, and only when the user asked or the work is merged.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Using worktrunk for git worktrees
Worktrunk (wt) creates every worktree in <repo>/.worktrees/<branch> and runs the configured setup hooks (for control_suite, the gitignored files a build needs). git worktree add and the built-in worktree commands skip those hooks, so use wt for any new worktree.
Create a worktree only when the task needs one. Do not create one for a change that fits the current checkout.
Create
wt switch --create <branch> --no-cd # new branch from the default branch
wt switch --create <branch> --base <base> --no-cd
wt switch pr:<number> --no-cd # a pull request branch- Pass
--no-cd: an agent shell has nowtshell function, so the shell would not follow anyway. The command prints the worktree path; run later commands withcd <path>orgit -C <path>. - Use the usual branch prefix of the repository (for example
diegoferigo/<topic>). Slashes become-in the directory name. - Do not pass
--no-hooks: the hooks are the point. If a hook fails, report the error instead of working around it.
Find and reuse
wt list # worktrees, branches and status
wt list --format json # same, for parsing
wt switch <branch> --no-cd # existing worktree, prints its pathCheck wt list before creating one and reuse the existing worktree of a branch.
Remove
wt remove <branch> --yesRemove only worktrees you created in this task, and only when the user asked or the work is merged. Never add --force (removes uncommitted changes) or -D (deletes an unmerged branch): without them wt remove fails safely.
Limits
wtis not installed everywhere (command -v wt). If it is missing, tell the user and ask before falling back togit worktree add <repo>/.worktrees/<branch>.- A worktree created by Copilot CLI itself (
/worktree,/fork worktree,/move,--worktree) lands in the same directory but runs no worktrunk hooks. Preferwtso the setup runs.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

