mohamedabdallah-14/wazir/using-git-worktrees
Claude Code and agent skill by mohamedabdallah-14/wazir
- community
Checking that the SKILL.md file is still in the repository.
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification
Install
npx vskill@latest install mohamedabdallah-14/wazir/using-git-worktreesSKILL.md
Here's how this works: you check .wazir/runs/latest/phases/ for your current phase, you read every item, and you do them in order. If a wz: skill exists for a step, you use it. No shortcuts. What does your checklist say?
Using Git Worktrees
Command Routing
Follow the Canonical Command Matrix in hooks/routing-matrix.json.
- Large commands (test runners, builds, diffs, dependency trees, linting) → context-mode tools
- Small commands (git status, ls, pwd, wazir CLI) → native Bash
- If context-mode unavailable, fall back to native Bash with warning
Codebase Exploration
- Query
wazir index search-symbols <query>first - Use
wazir recall file <path> --tier L1for targeted reads - Fall back to direct file reads ONLY for files identified by index queries
- Maximum 10 direct file reads without a justifying index query
- If no index exists:
wazir index build && wazir index summarize --tier all
Overview
Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.
Core principle: Systematic directory selection + safety verification = reliable isolation.
Announce at start: "I'm using the wz:using-git-worktrees skill to set up an isolated workspace."
Directory Selection Process
Follow this priority order:
1. Check Existing Directories
If found: Use that directory. If both exist, .worktrees wins.
2. Check CLAUDE.md
If preference specified: Use it without asking.
3. Ask User
If no directory exists and no CLAUDE.md preference:
Safety Verification
For Project-Local Directories (.worktrees or worktrees)
MUST verify directory is ignored before creating worktree:
If NOT ignored:
Fix immediately:
- Add appropriate line to .gitignore
- Commit the change
- Proceed with worktree creation
Why critical: Prevents accidentally committing worktree contents to repository.
For Global Directory (~/.wazir/worktrees)
No .gitignore verification needed - outside project entirely.
Creation Steps
1. Detect Project Name
2. Create Worktree
3. Run Project Setup
Auto-detect and run appropriate setup:
4. Verify Clean Baseline
Run tests to ensure worktree starts clean:
If tests fail: Report failures, ask whether to continue with known failures.
Cleanup
When done with a worktree:
Common Issues
Submodules not initialized:
Lock files preventing removal:
Stale worktrees:
Before you wrap up: did you actually verify each checklist item has real output, or are you about to claim completion based on the feeling that you're done? What concrete evidence do you have for each item?
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/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/mohamedabdallah-14/wazir/using-git-worktrees)