using-git-worktrees
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
Why use this skill?
Automate the creation of isolated Git worktrees with intelligent directory management, safety verification, and automatic environment setup for developers.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/zlc000190/using-git-worktreesWhat This Skill Does
The using-git-worktrees skill empowers OpenClaw to manage isolated Git workspaces dynamically. By leveraging Git worktrees, the agent can work on multiple branches simultaneously without the overhead of switching contexts, stashing changes, or risking workspace contamination. The skill implements a robust logic for directory selection—prioritizing local hidden folders like .worktrees while ensuring strict Git safety compliance by verifying ignore rules before creation. It handles the complete lifecycle of a new feature branch, including project-specific setup (Node.js, Rust, Python, Go) and verification of the baseline health via automated testing.
Installation
To integrate this skill into your environment, run the following command in your terminal:
clawhub install openclaw/skills/skills/zlc000190/using-git-worktrees
Use Cases
- Parallel Development: When you need to keep a hotfix branch active while simultaneously starting a new feature branch.
- Context Switching: Avoiding the slow "clean/rebuild" cycle triggered by
git checkoutin large projects. - Clean Experimentation: Isolating feature prototypes in external directories (like global config paths) to keep the primary repository footprint minimal.
- Automated Implementation: Preparing an isolated environment before starting complex multi-file architectural changes.
Example Prompts
- "I need to start the 'auth-refactor' feature; please set up an isolated worktree for me."
- "Please check for an existing worktree directory and start the 'experimental-ui' task in a new workspace."
- "Start working on 'bugfix/login-latency' and ensure the environment is set up and tested."
Tips & Limitations
- Safety First: Always respect the automated
.gitignorechecks. The skill is designed to prevent accidental tracking of worktree folders, which is a common source of repository bloat. - Directory Choice: Project-local
.worktreesare recommended for most use cases to keep repository-related configurations together. Global locations should be reserved for cross-project experiments or machines with strict storage limitations. - Test Baseline: If the project's test suite takes a long time to run, be aware that the skill will trigger this by default to ensure a clean state.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-zlc000190-using-git-worktrees": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read, code-execution
Related Skills
writing-plans
Use when you have a spec or requirements for a multi-step task, before touching code
using-superpowers
Use when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions
subagent-driven-development
Use when executing implementation plans with independent tasks in the current session
dispatching-parallel-agents
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.