From wtm
Manage Git worktrees using the wtm CLI. Triggers on: create worktree, add worktree, list worktrees, show worktree, remove worktree, delete worktree, switch worktree, worktree management, parallel branches, isolated workspace.
How this skill is triggered — by the user, by Claude, or both
Slash command
/wtm:worktreeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You manage Git worktrees using the `wtm` CLI tool.
You manage Git worktrees using the wtm CLI tool.
wtm must be available on PATHwtm add <name> [flags]
Creates a worktree under .wtm/<name>.
Arguments:
<name> (optional if -B is used): Worktree directory name. When omitted with -B, the name is derived from the branch name with slashes replaced by hyphens.Flags:
-b, --branch <name>: Create a new branch with the specified name-B, --checkout <name>: Use an existing branch--base <branch>: Set the base branch for a new branch (defaults to current HEAD)-m, --message <text>: Attach a note to the worktree at creation timeBehavior:
<name>-b and -B cannot be combinedExamples:
wtm add feature-auth # New worktree and branch "feature-auth"
wtm add api -b feature/api-refactoring --base main # New branch from main, worktree "api"
wtm add review-456 -B origin/feature/complex # Existing branch, worktree "review-456"
wtm add -B feature/long-name # Worktree auto-named "feature-long-name"
wtm list [--format <format>]
Alias: wtm ls
Formats:
table (default): Human-readable table with NAME, BRANCH, CREATED columnsplain: Script-friendly output: <name> <branch> <path> per linejson: Machine-readable JSON arrayExamples:
wtm list # Table format
wtm list --format plain # Script-friendly
wtm list --format json # JSON output
wtm show <name> [flags]
Flags:
--format <format>: Output format (pretty default, json)-f, --field <field>: Output only a specific fieldAvailable fields: name, branch, path, head, created, note
Examples:
wtm show api # Pretty format
wtm show api --format json # JSON
wtm show api -f path # Only the absolute path
wtm show api -f branch # Only the branch name
wtm remove <name> [flags]
Alias: wtm rm
Flags:
-f, --force: Skip interactive confirmation-d, --delete-branch: Delete associated branch (safe deletion)-D, --delete-branch-force: Force delete associated branchBehavior:
--force, prompts for confirmation-d and -D cannot be combinedExamples:
wtm remove feature-auth # Interactive confirmation
wtm remove feature-auth --force # Skip confirmation
wtm remove feature-auth -d # Remove worktree and safely delete branch
wtm remove feature-auth -D # Remove worktree and force delete branch
Worktrees can have freeform text notes. See the wtm:notes skill for full wtm notes command documentation.
Quick reference:
wtm add <name> -m "message"wtm show <name> -f notewtm config edit
Opens .wtm/config.toml in $EDITOR. Creates the file if it doesn't exist.
wtm version
<repo-root>/
└── .wtm/
├── .gitignore # Auto-created, excludes worktrees from git
├── config.toml # Project-specific configuration and hooks
├── <worktree-name>/ # Git worktree checkout
└── <worktree-name>/ # Another worktree
wtm is stateless. Git stores all worktree metadata. The .wtm/ directory only contains the actual worktree checkouts and configuration.
Hooks run automatically after wtm add. Global hooks run first, then project hooks.
~/.config/wtm/config.toml (or $XDG_CONFIG_HOME/wtm/config.toml).wtm/config.toml| Type | Fields | Description |
|---|---|---|
copy | paths | Copy files from repo root to worktree |
link | paths | Create symlinks from worktree to repo root |
shell | run | Execute a shell command in worktree directory |
Each hook can set on_error:
"warn" (default): Print warning and continue"continue": Silently skip on error"abort": Stop execution (worktree remains created)# .wtm/config.toml
[[hooks.post-add]]
type = "copy"
paths = [".env", "config/local.json"]
[[hooks.post-add]]
type = "link"
paths = ["node_modules"]
on_error = "continue"
[[hooks.post-add]]
type = "shell"
run = "npm install"
on_error = "abort"
--force flag when removing worktrees non-interactivelywtm list --format json or wtm show <name> --format json when you need to parse output programmaticallywtm show <name> -f path to get the absolute path for cd or file operationsnpx claudepluginhub choplin/wtm --plugin wtmCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.