Git Worktrees
Manage multiple Git worktrees efficiently to isolate development branches and reduce repository clutter.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add jamesrochabrun-git-worktrees npx -- -y @trustedskills/jamesrochabrun-git-worktrees
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"jamesrochabrun-git-worktrees": {
"command": "npx",
"args": [
"-y",
"@trustedskills/jamesrochabrun-git-worktrees"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
The git-worktrees skill enables AI agents to manage multiple parallel branches within a single Git repository without cluttering the main working directory. It allows agents to create, switch between, and delete worktrees, facilitating isolated development environments for different features or experiments.
When to use it
- Isolating experimental code changes from the stable main branch to prevent accidental merges.
- Managing parallel development of multiple features simultaneously within one repository.
- Testing specific branches in a clean environment before integrating them back into the primary workflow.
- Maintaining a tidy working directory by keeping unrelated tasks in separate worktrees rather than switching branches constantly.
Key capabilities
- Creating new worktrees based on existing branches or commits.
- Listing all available worktrees and their associated branch names.
- Switching the active worktree to a specific path or branch.
- Deleting unused worktrees to reclaim disk space and clean up the repository structure.
Example prompts
- "Create a new worktree named 'feature-auth' based on the current HEAD for testing authentication logic."
- "List all existing worktrees in this repository and show which branches they are tracking."
- "Delete the old worktree at '/tmp/legacy-fix' as it is no longer needed."
Tips & gotchas
Ensure the AI agent has write permissions to the target directory, as creating or deleting worktrees modifies the filesystem. Be mindful of disk space usage when managing many concurrent worktrees, as each maintains its own copy of the checked-out files.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.