Skip to main content
skill CX Codex

git-worktrees — Claude Code skill: what it does, how to install

Teaches your AI coding assistant to manage multiple linked Git working trees. Helpful for handling hotfixes, PR reviews, and parallel builds without stashing changes.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add NeoLabHQ/context-engineering-kit --skill git-worktrees -a claude-code
Open on GitHub

What git-worktrees does

This skill guides coding agents through Git worktree workflows. Instead of cloning a repository twice or stashing work, developers can keep multiple checkouts linked to the same .git object database. Context switching happens simply by changing directories.

The instructions cover creating linked trees, tracking remote branches, side-by-side file comparisons, and cleaning up stale references. Git enforces a strict rule: a single branch cannot be checked out in two worktrees at once. Deleting a dirty directory requires the --force flag. That safeguard protects uncommitted edits from accidental loss during project cleanup.

What it helps with

  • isolate urgent hotfixes without stashing ongoing work
  • inspect pull requests in dedicated folders while keeping code active
  • diff implementations across two distinct branches side by side
  • run background test suites in a clean directory
  • cherry-pick selected changes across multiple working copies

Example prompts for the agent

  • Create a new worktree for branch hotfix-456 from main in a sibling directory.
  • Set up an isolated worktree to review pull request 123 and run tests there.
  • Compare src/module.js between the main worktree and feature-1 worktree.

How to install git-worktrees

1Skills CLI (Vercel)

npx skills add NeoLabHQ/context-engineering-kit --skill git-worktrees -a claude-code

2Manually: put the files in place

~/.claude/skills/git-worktrees/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/git-worktrees/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about git-worktrees

How to install git-worktrees in Claude Code?

Run this command in your terminal: npx skills add NeoLabHQ/context-engineering-kit --skill git-worktrees -a claude-code. The skill will register with your agent configuration.

What does git-worktrees do?

It provides workflow rules and CLI patterns for linked Git working directories. The agent learns to create separate folders sharing one repository without duplicating objects.

Can multiple worktrees share the same branch simultaneously?

No, Git locks each branch to one active worktree. If you need that branch elsewhere, remove or switch the existing worktree first.

Similar skills

All skills for Git and GitHub →

From the same set55

propose-hypotheses Runs the whole First Principles Framework cycle: generates competing hypotheses, verifies logic, validates evidence and produces a decision record. CX Codex +1 1,200installs create-command Interactive helper for drafting custom slash commands. Configures frontmatter, argument handling, and pre-run bash context. CX Codex +1 1,200installs setup-arxiv-mcp Sets up an academic paper search MCP server through Docker MCP and records its tools in CLAUDE.md. Use it when an agent needs to search or read research papers. CX Codex +1 1,200installs attach-review-to-pr This skill shows the agent how to post review comments on specific lines of a pull request using GitHub CLI or an MCP tool. Handy when review happens in the terminal. CX Codex +1 1,200installs actualize Checks an FPF knowledge base against Git changes and flags evidence or decisions that may need review. Use it before new work or after repository changes. CX Codex +1 1,200installs create-hook The skill scans your project and suggests hooks for your stack: type checks, formatting, linting, tests. Then it writes the script and tests it. CX Codex +1 1,200installs create-pr Opens draft pull requests through the GitHub CLI using repository templates. It checks for uncommitted changes and formats PR titles with emojis. CX Codex +1 1,200installs analyze-issue Analyzes a GitHub issue, reviews related code, and saves a technical specification. Use it before starting work on a tracked task. CX Codex +1 1,200installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor