Start work on a new branch or worktree. Use when asked to start a new branch, new worktree, begin work on a feature/fix, or start fresh. Supports issue numbers and plain descriptions.
Start work on a new git branch, optionally in a new worktree.
Accepts one of the following as arguments:
/branch 123 — fetches the issue title and derives the branch name/branch add shellcheck support — derives the branch name from the text--worktree or -w to create a git worktree instead of a regular branchExamples:
/branch 123 — branch from issue #123/branch add dark mode toggle — branch from description/branch 123 --worktree — worktree from issue #123/branch fix login redirect -w — worktree from descriptionDerive the branch name using this format:
<type>/<issue-number?>-<slug>
feat/, fix/, chore/, docs/, refactor/, perf/, test/, ci/
bug → fix/, enhancement → feat/, documentation → docs/feat/ if unclearadd-shellcheck-supportExamples:
feat/123-add-watch-modebug, titled "Parser crashes on empty input" → fix/45-parser-crashes-on-empty-inputfeat/add-dark-modefix/resolve-null-pointerWhen asked to start a new branch (no --worktree / -w flag):
git status — if there are uncommitted changes, warn the user and stopgit fetch origin
gh issue view <number> --json title,labelsgit checkout -b <branch-name> origin/main
When --worktree or -w is specified:
git status — if there are uncommitted changes, warn the user and stopgit fetch origin
<repo-dir>-<slug> (without the type prefix)~/Code/py-lintro and branch is feat/123-add-watch-mode:
~/Code/py-lintro-123-add-watch-modefix/parser-crash:
~/Code/py-lintro-parser-crashgit worktree add -b <branch-name> <worktree-path> origin/main
Created worktree at ~/Code/py-lintro-123-add-watch-mode
Branch: feat/123-add-watch-mode (from origin/main)
To start working:
cd ~/Code/py-lintro-123-add-watch-mode
origin/main (freshly fetched)