Using Git Worktrees for Openclaw

A specialized skill for creating and managing isolated Git workspaces with automated safety checks and environment setup.

zlc000190
v0.1.0
Feb 10, 2026
0
3.6k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install using-git-worktrees

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install using-git-worktrees using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Using Git Worktrees?

Using Git Worktrees provides a systematic approach for AI agents to handle multiple development branches simultaneously without the overhead of constant context switching. By utilizing the native Git worktree feature, this skill enables Openclaw Skills to maintain high productivity by isolating feature work, dependency installations, and build artifacts from the main project directory. It ensures that every new task starts from a clean, verified state while preventing accidental repository pollution.

The skill is built on a core principle of systematic directory selection combined with safety verification. Whether working on complex implementation plans or parallel subagent tasks, this tool ensures that the environment is correctly configured, ignored by version control, and ready for immediate development without manual intervention.

Using Git Worktrees Use Cases

  • Starting new feature work that needs strict isolation from the current working directory.
  • Executing multi-branch implementation plans without losing local uncommitted changes.
  • Running long-duration tests or builds in the background while continuing development.
  • Setting up clean environments for subagent-driven development tasks.
  • Managing multiple project versions or hotfixes concurrently in Openclaw Skills workflows.

How Using Git Worktrees Works

  1. Search for existing worktree directories like .worktrees or worktrees to maintain project consistency.
  2. Consult CLAUDE.md for pre-defined user preferences regarding workspace locations.
  3. Verify that the target directory is properly ignored by git to prevent accidental tracking of worktree content.
  4. Detect the project type and create a new branch within the designated worktree path.
  5. Execute automated setup scripts based on detected configuration files like package.json or Cargo.toml.
  6. Run baseline tests to ensure the new workspace is stable before starting any feature implementation.

Using Git Worktrees Setup

To prepare your project for this skill, it is recommended to have a designated worktree directory ignored in your version control. This ensures Openclaw Skills can operate safely.

# Add the preferred worktree directory to your .gitignore
echo ".worktrees/" >> .gitignore
git add .gitignore
git commit -m "chore: add worktrees to gitignore"

# The skill will then handle creation automatically
git worktree add .worktrees/my-new-feature -b my-new-feature

Using Git Worktrees Data Schema & Taxonomy

The skill follows a specific hierarchy for directory selection and metadata management to ensure data integrity across Openclaw Skills integrations.

Priority Location Logic
1 .worktrees/ Local hidden directory (preferred)
2 worktrees/ Local visible directory (alternative)
3 CLAUDE.md Checks for worktree directory preference
4 Global Config ~/.config/superpowers/worktrees/<project>/

Using Git Worktrees Advanced Features

  • Smart directory selection priority: existing directories > CLAUDE.md > user prompt.
  • Automated safety verification using git check-ignore to protect the main repository.
  • Dynamic project setup detection for Node.js, Rust, Python, and Go environments.
  • Baseline test verification to identify pre-existing bugs before starting new work.
  • Tight integration with brainstorming and subagent-driven development phases within Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*