microsoft/fluidframework/using-git-worktrees
Claude Code and agent skill by microsoft/fluidframework
- vendor
Checking that the SKILL.md file is still in the repository.
Use this whenever you need to create an isolated workspace.
Install
npx vskill@latest install microsoft/fluidframework/using-git-worktreesSKILL.md
The same SKILL.md was published earlier as microsoft/fluidframework/using-git-worktrees.
<required> CRITICAL Add the following steps to your Todo list using TodoWrite:
- Find the worktrees directory.
- Check existing directories using the Bash tool:
ls -d .worktrees 2>/dev/null - If not found, ask me for permission to create a .worktrees directory
- If given permission, create
.worktrees.
- Verify .gitignore before creating a worktree using the Bash tool:
- If not found, add the appropriate line to the .gitignore immediately.
- Create the worktree
- Come up with a good branch name based on the request.
- Create the worktree with the Bash tool: `git worktree add ".worktrees/$BRANCH_NAME" -b "$BRANCH_NAME"
- cd into the newly created path with the Bash tool:
cd $path
- Auto-detect and run project setup.
- If there is no obvious project setup, you _MUST_ ask me.
- Run tests to ensure the worktree is clean.
If tests fail: Report failures, ask whether to proceed or investigate.
If tests pass: Report ready.
- Report Location
- Understand that you are now in a new working directory. Your Bash tool instructions from here on out should refer to the worktree directory, NOT your original directory. This is ABSOLUTELY CRITICAL.
</required>
Maintaining Working Directory in Worktree
CRITICAL: Once you create and enter a worktree, you must stay within it for the entire session.
Rules:
- Never use cd .. from within a worktree - It will eventually take
you outside the worktree boundary
- Always use absolute paths for commands - Use npm run lint from
within the worktree, not cd .. && npm run lint
- If you need to run root-level commands, use the full worktree path:
<bad-example> cd .. && npm run lint </bad-example> <good-example> npm run lint # (from worktree root) </good-example>
<good-example> cd /home/$USER/code/project/.worktrees/branch-name && npm run lint </good-example>
- Verify your location frequently:
- If you accidentally exit the worktree:
- Immediately recognize it (check if you're on main branch)
- Navigate back: cd /full/path/to/.worktrees/your-branch
- Verify: git branch should show your branch, not main
Red Flags:
- Running git status and seeing "On branch main" when you should be on a feature branch
- Running pwd and NOT seeing .worktrees/ in the path
- Any cd .. command while in a worktree
Quick Reference
| Situation | Action | |
|---|---|---|
.worktrees/ exists | Use it (verify .gitignore) | |
| `.worktree/s does not exist | Check CLAUDE.md → Ask user | |
| Directory not in .gitignore | Add it immediately | |
| Tests fail during baseline | Report failures + ask | |
| No package.json/Cargo.toml | Skip dependency install |
Common Mistakes
Skipping .gitignore verification
- Problem: Worktree contents get tracked, pollute git status
- Fix: Always grep .gitignore before creating project-local worktree
Assuming directory location
- Problem: Creates inconsistency, violates project conventions
- Fix: Follow priority: existing > CLAUDE.md > ask
Missing project installation
- Problem: Tests and lint will fail, breaking the project
- Fix: Always install the project when creating a new worktree
Proceeding with failing tests
- Problem: Can't distinguish new bugs from pre-existing issues
- Fix: Report failures, get explicit permission to proceed
Hardcoding setup commands
- Problem: Breaks on projects using different tools
- Fix: Auto-detect from project files (package.json, etc.)
Example Workflow
Red Flags
Never:
- Create worktree without .gitignore verification (project-local)
- Skip baseline test verification
- Proceed with failing tests without asking
- Assume directory location when ambiguous
- Skip CLAUDE.md check
Always:
- Follow directory priority: existing > CLAUDE.md > ask
- Verify .gitignore for project-local
- Auto-detect and run project setup
- Verify clean test baseline
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 15 Nov 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.agency/plugins/nori/skills/using-git-worktrees/SKILL.md
Popularity
- Repository stars
- 4,946
- Repository forks
- 586
- 7-day trend score
- 43
Stars and forks are for the whole GitHub repository, not this skill alone. 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/microsoft/fluidframework/using-git-worktrees)