Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Forge Git Worktrees?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ansh44233-forge-git-worktrees)
---
name: forge-git-worktrees
description: "Run parallel agents and experiments safely with git worktrees: setup, isolation, comparing and cleaning up"
---
<!-- Generated from catalog/skills/git-worktrees/SKILL.md by scripts/build-plugin.ts. Edit the catalog, not this file. -->
# Git worktrees for parallel work
Use when running several agents or experiments at once, or when you need a second checkout without stashing.
## Basics
- `git worktree add ../app-feature -b feature/x` creates a separate working directory on its own branch, sharing the same repository.
- `git worktree add --detach <path> HEAD` gives a throwaway checkout of the current commit.
- `git worktree list` and `git worktree remove <path>` (then `git worktree prune`) keep things tidy.
## Isolation
- Each worktree needs its own dependencies and build outputs. Install, or symlink a gitignored `node_modules` when it is safe.
- Give each one distinct ports, databases or containers when agents run servers or tests at the same time.
- A branch can be checked out in only one worktree at a time.
## Comparing agents
`forge race --goal "..." --check "npm test" --agents claude,codex` does this for you. Each agent gets a detached worktree from the same commit, runs FORGE's verified loop, and gets ranked by FORGE's own checks and the integrity gate. `forge race pick` applies the winner with a 3-way merge.
## Clean up
Remove worktrees when done (`forge race clean` for races). Stale worktrees keep branches locked and use disk space.
## Verify
`git worktree list` shows only what you expect, and the main working tree contains only the changes you picked.