Finishing a Development Branch
obra/superpowers
Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.
Interactive guide for parallel development with Ghostty, git worktrees, and Lazygit.
$ npx skills add davila7/claude-code-templates --skill worktree-guide -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install davila7/claude-code-templates worktree-guide --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .claude/skills && cp -r skills-src/cli-tool/components/skills/development/worktree-guide .claude/skills/worktree-guide && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "worktree-guide" agent skill from https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/development/worktree-guide into .claude/skills/worktree-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "worktree-guide", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/development/worktree-guideType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add davila7/claude-code-templates --skill worktree-guide -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install davila7/claude-code-templates worktree-guide --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .agents/skills && cp -r skills-src/cli-tool/components/skills/development/worktree-guide .agents/skills/worktree-guide && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "worktree-guide" agent skill from https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/development/worktree-guide into .agents/skills/worktree-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "worktree-guide", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add davila7/claude-code-templates --skill worktree-guide -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install davila7/claude-code-templates worktree-guide --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/cli-tool/components/skills/development/worktree-guide .cursor/skills/worktree-guide && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "worktree-guide" agent skill from https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/development/worktree-guide into .cursor/skills/worktree-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "worktree-guide", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/davila7/claude-code-templates.git --path cli-tool/components/skills/development/worktree-guide--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add davila7/claude-code-templates --skill worktree-guide -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install davila7/claude-code-templates worktree-guide --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/cli-tool/components/skills/development/worktree-guide .gemini/skills/worktree-guide && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "worktree-guide" agent skill from https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/development/worktree-guide into .gemini/skills/worktree-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "worktree-guide", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install davila7/claude-code-templates worktree-guideInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add davila7/claude-code-templates --skill worktree-guide -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .github/skills && cp -r skills-src/cli-tool/components/skills/development/worktree-guide .github/skills/worktree-guide && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "worktree-guide" agent skill from https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/development/worktree-guide into .github/skills/worktree-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "worktree-guide", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add davila7/claude-code-templates --skill worktree-guide -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install davila7/claude-code-templates worktree-guide --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/cli-tool/components/skills/development/worktree-guide .opencode/skills/worktree-guide && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "worktree-guide" agent skill from https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/development/worktree-guide into .opencode/skills/worktree-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "worktree-guide", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
worktree-guideInteractive guide for parallel development with Ghostty, git worktrees, and Lazygit.
Worktree Guide is an agent skill from davila7/claude-code-templates. Interactive guide for parallel development with Ghostty, git worktrees, and Lazygit. Use when setting up multi-task workflows or learning the worktree system.
Its SKILL.md is about 3.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Development, covering Git worktrees. It works with Git. The repository describes itself as: CLI tool for configuring and monitoring Claude Code. The licence is MIT.
6 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 4c82aba. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
gitclaudeFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Worktree Guide loads about 3.7k tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 269 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from davila7/claude-code-templates at commit 4c82aba, republished under its MIT licence (© davila7). 269 words, ~3,691 tokens.
.claude/skills/worktree-guide/SKILL.md (or your agent's skills folder).Guide the user through parallel development workflows using Ghostty terminal panels, git worktrees, and Lazygit. This is both a teaching experience and a practical reference.
Before starting, detect the user's environment:
git rev-parse --is-inside-work-tree 2>&1 && echo "GIT_OK" || echo "NOT_GIT"If not a git repo:
This isn't a git repository. Navigate to a git project first, then come back to
/worktree-guide.
Check if we're in a worktree or main repo:
git worktree list
pwdNote the context for later guidance.
Display based on environment:
If in main repo:
## Worktree Parallel Development Guide
Welcome! I'll guide you through setting up and using parallel worktrees for multi-task development.
┌─────────────────────────────────────────────────────────────┐
│ Ghostty Terminal │
│ ┌──────────────────────┬──────────────────────┐ │
│ │ │ │ │
│ │ Claude (Task 1) │ Claude (Task 2) │ │
│ │ claude/login-page │ claude/fix-auth-bug │ │
│ │ │ │ │
│ ├──────────────────────┴──────────────────────┤ │
│ │ Lazygit (monitoring) │ │
│ └─────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
**Your workflow:**
1. Create worktrees → `/worktree-init`
2. Open Ghostty panels → `Cmd+D` / `Cmd+Shift+D`
3. Run Claude in each panel → `cd <worktree> && claude`
4. Deliver when done → `/worktree-deliver`
5. Clean up → `/worktree-cleanup`
What would you like to do?Use AskUserQuestion:
/worktree-initIf already in a worktree:
## Worktree Status
You're already inside a worktree! Let me check your status.Then run the equivalent of /worktree-check and provide contextual guidance.
EXPLAIN:
## Ghostty Panel Management
Ghostty's panel system is perfect for parallel development. Here are the essential keybindings:SHOW:
┌─────────────────────────────────────────────────────────────┐
│ GHOSTTY KEYBINDINGS │
├─────────────────────────────────────────────────────────────┤
│ │
│ SPLITTING │
│ ───────── │
│ Cmd+D Split panel to the right │
│ Cmd+Shift+D Split panel below │
│ │
│ NAVIGATION │
│ ───────── │
│ Cmd+Alt+←/→/↑/↓ Move focus between panels │
│ Cmd+[/] Cycle through panels │
│ │
│ SIZING │
│ ───────── │
│ Cmd+Shift+E Equalize all panel sizes │
│ Cmd+Shift+F Toggle zoom (fullscreen current panel) │
│ │
│ CLOSING │
│ ───────── │
│ Cmd+W Close current panel │
│ │
└─────────────────────────────────────────────────────────────┘
**Pro tip:** Use Cmd+Shift+F to zoom into a panel when you need focus, then press it again to return to the multi-panel view.PAUSE - "Ready to learn about Lazygit? (Or skip to workflow)"
EXPLAIN:
## Lazygit for Monitoring Worktrees
Lazygit gives you a visual overview of all your worktrees and their changes. Run it from your main repo to monitor everything.SHOW:
┌─────────────────────────────────────────────────────────────┐
│ LAZYGIT KEYBINDINGS │
├─────────────────────────────────────────────────────────────┤
│ │
│ WORKTREES (navigate to Worktrees panel) │
│ ───────── │
│ w Switch to worktree panel (or create new) │
│ Enter Switch to selected worktree │
│ n Create new worktree │
│ d Delete worktree (with confirmation) │
│ │
│ FILES & STAGING │
│ ───────── │
│ Space Stage/unstage file │
│ a Stage all files │
│ Enter View file diff (with Delta highlighting) │
│ │
│ COMMITS │
│ ───────── │
│ c Commit staged changes │
│ C Commit with editor │
│ A Amend last commit │
│ │
│ SYNC │
│ ───────── │
│ P Push │
│ p Pull │
│ f Fetch │
│ │
│ GENERAL │
│ ───────── │
│ ? Help (context-sensitive) │
│ q Quit / go back │
│ Tab Switch panels │
│ │
└─────────────────────────────────────────────────────────────┘
**Monitoring workflow:**
1. Open lazygit in the main repo (or a dedicated Ghostty panel)
2. Press `w` to see all worktrees
3. Use Enter to dive into any worktree's changes
4. Press `q` to go back to the worktree listPAUSE - "Ready for the full workflow walkthrough?"
EXPLAIN:
## Full Parallel Development Workflow
Let me walk you through the complete cycle. We'll go step by step.EXPLAIN:
### Step 1: Create Worktrees
First, define the tasks you want to work on in parallel. The `/worktree-init` command creates a worktree for each task.DO: Show example command:
Example usage:
/worktree-init add user authentication | fix login bug | improve dashboard performance
This creates:
├── ../worktrees/<repo>/claude-add-user-authentication/
├── ../worktrees/<repo>/claude-fix-login-bug/
└── ../worktrees/<repo>/claude-improve-dashboard-performance/EXPLAIN:
### Step 2: Open Ghostty Panels
Now split your terminal into panels—one for each task, plus optionally one for Lazygit monitoring.DO:
1. Press Cmd+D to split right (first worktree)
2. Press Cmd+D again (second worktree)
3. Optionally press Cmd+Shift+D on any panel for Lazygit below
Resulting layout:
┌──────────┬──────────┬──────────┐
│ Task 1 │ Task 2 │ Task 3 │
│ claude │ claude │ claude │
├──────────┴──────────┴──────────┤
│ lazygit │
└────────────────────────────────┘EXPLAIN:
### Step 3: Work Independently
In each panel:
1. cd to the worktree path (from the commands output)
2. Run `claude` to start a Claude session
3. Use `/worktree-check` anytime to verify which task you're working on
4. Work normally—Claude doesn't know about other panelsEXPLAIN:
### Step 4: Deliver When Done
When you finish a task in any panel, use `/worktree-deliver` to:
1. Review your changes
2. Create a commit
3. Push to remote
4. Create a pull requestEXPLAIN:
### Step 5: Clean Up After Merging
After your PRs are merged on GitHub:
1. Go back to the main repo (not a worktree)
2. Run `/worktree-cleanup --all`
3. It removes merged worktrees and branchesSHOW:
## Troubleshooting
### "I'm not sure which worktree I'm in"
Run `/worktree-check` — it shows your branch, task, and status.
Alternatively:
$ git branch --show-current # Shows claude/<name>
$ pwd # Shows the worktree path
---
### "I have uncommitted changes and want to switch tasks"
**Option 1:** Commit work-in-progress
$ git add . && git commit -m "wip: progress on feature"
**Option 2:** Stash changes (temporary)
$ git stash push -m "wip: parking changes"
Then in the other panel, continue working. Come back later with:
$ git stash pop
---
### "I accidentally started working in the wrong worktree"
1. Stash your changes: `git stash push -m "work done in wrong place"`
2. Navigate to the correct worktree
3. Apply the stash: `git stash pop`
---
### "My worktree has merge conflicts"
1. Run `git fetch origin` to get latest
2. Run `git rebase origin/main` (or merge if you prefer)
3. Resolve conflicts in your editor
4. `git add .` then `git rebase --continue`
---
### "I want to abandon a worktree"
From the main repo:
$ git worktree remove ../worktrees/repo/claude-<name> --force
$ git branch -D claude/<name>
Note: Force is needed if there are uncommitted changes.
---
### "/worktree-deliver failed on push"
Usually means the remote branch doesn't exist yet or there's a conflict.
Try:
$ git push -u origin HEAD
If there's a conflict with remote, pull first:
$ git pull --rebase origin claude/<name>
---
### "The worktree path doesn't exist anymore"
The worktree was probably deleted manually. Clean up the git state:
$ git worktree pruneSHOW:
┌─────────────────────────────────────────────────────────────────────────────┐
│ WORKTREE QUICK REFERENCE │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ COMMANDS │
│ ───────── │
│ /worktree-init <task1> | <task2> Create worktrees for parallel tasks │
│ /worktree-check Show current worktree status & task │
│ /worktree-deliver Commit, push, and create PR │
│ /worktree-cleanup --all Remove merged worktrees and branches │
│ /worktree-cleanup --dry-run Preview what would be cleaned up │
│ │
│ GHOSTTY │
│ ───────── │
│ Cmd+D Split right │ Cmd+Shift+E Equalize panels │
│ Cmd+Shift+D Split down │ Cmd+Shift+F Zoom toggle │
│ Cmd+Alt+Arrows Navigate │ Cmd+W Close panel │
│ │
│ LAZYGIT │
│ ───────── │
│ w Worktrees panel │ Space Stage/unstage │
│ Enter View diff │ c Commit │
│ P Push │ ? Help │
│ │
│ GIT (manual) │
│ ───────── │
│ git worktree list List all worktrees │
│ git worktree add -b claude/name path Create worktree manually │
│ git worktree remove path Remove a worktree │
│ git worktree prune Clean up stale worktree refs │
│ │
│ WORKFLOW │
│ ───────── │
│ 1. /worktree-init tasks... Create worktrees │
│ 2. Cmd+D (split panels) Open Ghostty panels │
│ 3. cd <path> && claude Start Claude in each │
│ 4. /worktree-deliver PR when done │
│ 5. /worktree-cleanup Clean up after merge │
│ │
└─────────────────────────────────────────────────────────────────────────────┘/worktree-check first© davila7, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in cli-tool/components/skills/development/worktree-guide of davila7/claude-code-templates.
Open the folder on GitHubat commit 4c82aba
Worktree Guide next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Worktree Guide this skilldavila7/claude-code-templates | 32k | — | ~3.7k | Automated safety check: Pass | MIT | |
| Finishing a Development Branchobra/superpowers | 296k | 5 repos | ~1.9k | Automated safety check: Pass | MIT | |
| Finishing A Development Branchfarm-fe/farm | 5.6k | 33 repos | ~1.8k | Automated safety check: Pass | MIT | |
| Git Worktree Cleanuplobehub/lobehub | 83k | — | ~2.8k | Automated safety check: Pass | Custom licence | |
| Pre-Release PR Triagejamiepine/voicebox | 57k | — | ~3.1k | Automated safety check: Pass | MIT | |
| Ccmanager Configkbwo/ccmanager | 1.3k | — | ~1.5k | Automated safety check: Pass | MIT |
obra/superpowers
Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.
farm-fe/farm
A skill your agent uses when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for…
lobehub/lobehub
Audits stale Git worktrees and branches with a bundled script, classifies each one, and deletes only after you approve the exact candidates.
jamiepine/voicebox
Sorts a backlog of open pull requests into must-merge, candidate, superseded and deferred, writes a triage doc and works the merge loop before a release.
kbwo/ccmanager
Set up, review, or repair a CCManager config — .ccmanager.json at a git repository root, or the global ~/.config/ccmanager/config.json.
CapSoftware/Cap
Builds a Cap feature in an isolated Git worktree with disposable dev resources, verification, a recorded demo and a neutral pull request, started with /building.
davila7/claude-code-templates
Runs web-grounded searches through Perplexity's Sonar models over OpenRouter for current events, recent literature and cited facts beyond the model's training cutoff.
davila7/claude-code-templates
Analyzes Neuropixels recordings from SpikeGLX or Open Ephys through preprocessing, drift correction, Kilosort4 spike sorting, quality metrics and curation.
davila7/claude-code-templates
Supplies LaTeX templates and formatting rules for journals, conferences, posters, and grant proposals, then can check a draft against them.
davila7/claude-code-templates
Analyzes a brand's existing writing to lock in a consistent voice, then builds SEO blog posts and platform-specific social content around it.
davila7/claude-code-templates
Guides corrective and preventive action (CAPA) work in a quality management system, from initiation and root cause analysis through effectiveness verification.
davila7/claude-code-templates
Senior FDA consultant and specialist for medical device companies including HIPAA compliance and requirement management.
Works with
Categories
Interactive guide for parallel development with Ghostty, git worktrees, and Lazygit. Worktree Guide is an agent skill from davila7/claude-code-templates. Interactive guide for parallel development with Ghostty, git worktrees, and Lazygit.
Worktree Guide fits situations like: setting up multi-task workflows; learning the worktree system.
Run `npx skills add davila7/claude-code-templates --skill worktree-guide -a claude-code`. Or copy the skill folder (cli-tool/components/skills/development/worktree-guide in davila7/claude-code-templates) into .claude/skills/worktree-guide in your project. Claude Code loads it when a task matches its description.
Run `npx skills add davila7/claude-code-templates --skill worktree-guide -a codex`. Or copy the skill folder (cli-tool/components/skills/development/worktree-guide in davila7/claude-code-templates) into .agents/skills/worktree-guide in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add davila7/claude-code-templates --skill worktree-guide -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/worktree-guide, .gemini/skills/worktree-guide, .github/skills/worktree-guide and .opencode/skills/worktree-guide in your project.
Going by SKILL.md and its folder, Worktree Guide needs the command-line tools its instructions call (git and claude).
SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Worktree Guide is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.7k tokens (SKILL.md is roughly 15k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Worktree Guide: Finishing a Development Branch (obra/superpowers, 296k stars), Finishing A Development Branch (farm-fe/farm, 5.6k stars), Git Worktree Cleanup (lobehub/lobehub, 83k stars) and Pre-Release PR Triage (jamiepine/voicebox, 57k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
davila7 (a GitHub user) maintains it in davila7/claude-code-templates, which has 32,432 GitHub stars. The repository holds 477 skills in this directory. The repository was last updated on October 7, 2026.
Source: davila7/claude-code-templates on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.