bells0/agentic-superpowers/agentic-using-git-worktrees
Claude Code and agent skill by bells0/agentic-superpowers
- community
Checking that the SKILL.md file is still in the repository.
Prepare or verify safe Git worktree isolation for local repository work. Use when the user requests a worktree, concurrent tasks need separate branches, the current checkout contains conflicting user changes, or long-lived or risky implementation benefits from isolation. Exclude ordinary edits already safe in the current checkout and tasks already running in an isolated worktree.
Install
npx vskill@latest install bells0/agentic-superpowers/agentic-using-git-worktreesSKILL.md
The same SKILL.md was published earlier as bells0/agentic-superpowers/agentic-using-git-worktrees.
Agentic Worktree Isolation
Create only the isolation the task needs. Detect the current state first, prefer Codex-native worktree controls, and preserve user changes.
Decide whether isolation helps
A direct request for a worktree authorizes creation. Otherwise, use one only when concurrent work, overlapping branch state, a dirty checkout, or a long-lived risky change makes isolation materially safer. If the benefit is marginal, work in place.
Before creating anything, inspect:
Resolve the reported Git paths before comparing them. A linked worktree has a different Git directory and common directory; a submodule can look similar, so treat a non-empty superproject path as a submodule rather than proof of worktree isolation.
If already isolated, keep the existing worktree. Do not nest another one. Record whether it is on a branch or detached HEAD.
Create isolation safely
- Prefer a Codex or harness-native worktree action when the current task can use it. The Agent creates or selects the branch; never ask the user to perform this mechanic. Native controls own placement, branch state, handoff, and cleanup; do not create invisible parallel state behind them.
- If no native path is available, use
git worktreedirectly. - Honor explicit branch and directory choices. Otherwise use the repository's existing
.worktrees/orworktrees/convention;.worktrees/wins when both exist. - Before using a project-local directory, verify it is ignored with
git check-ignore. Do not silently edit.gitignoreor create a commit solely to make worktree setup succeed. Use an approved external location or ask when no safe location exists. - Use the
codex/branch prefix unless the user or repository specifies another convention. - Resolve the final absolute target and confirm it is not the repository root, home directory, or an existing unrelated path before running
git worktree add.
Uncommitted changes in the source checkout do not automatically appear in a new worktree. If the requested task depends on them, work in the current checkout or obtain a safe, explicit transfer decision. Never stash, copy, commit, or discard unrelated user changes merely to populate the worktree.
Prepare the worktree
Follow repository instructions for setup. Do not automatically install every detected ecosystem dependency. Reuse existing caches and run only setup commands required to make the task executable.
Establish a proportionate baseline:
- run a targeted check that covers the area about to change;
- broaden only when project rules or the task's integration boundary requires it;
- distinguish pre-existing failures from failures introduced later;
- report a blocking baseline problem instead of claiming the workspace is clean.
Do not start implementation on main, master, or another default branch. A direct-default-branch emergency requires explicit user authorization and a recorded reason; native workflow management alone is not an exception.
Hand off and finish
Report:
- worktree absolute path;
- branch or detached state;
- source revision;
- preserved uncommitted source changes;
- setup and baseline evidence;
- any limitation affecting later cleanup.
Let agentic-git-delivery own atomic completion commits, feature-branch push, PR delivery, and safe post-merge cleanup. Worktree creation alone never authorizes merge, branch deletion, or removal of another worktree.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/agentic-using-git-worktrees/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/bells0/agentic-superpowers/agentic-using-git-worktrees)