dev-repo-worktrees

Isolate per-session git worktrees to prevent HEAD drift in multi-session Claude Code workflows.

31|20|Updated Apr 9, 2026
One-click install
npx skills add https://github.com/mycelium-hq/ai-brain-starter --skill dev-repo-worktrees
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dev-repo-worktrees
Source: https://github.com/mycelium-hq/ai-brain-starter/tree/main/skills/dev-repo-worktrees
Command: npx skills add https://github.com/mycelium-hq/ai-brain-starter --skill dev-repo-worktrees

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Isolates per-session worktrees to prevent HEAD drift when multiple Claude Code sessions edit the same repo.

Core Features & Use Cases

  • Isolates each session with its own worktree at ~/dev/<repo>-<slug>/, keeping HEAD, index, and working tree independent.
  • Ships a wrapper script and a hookify warn rule to enforce isolation, reducing HEAD-drift risks in multi-session workflows.
  • Complements recovery workflows by providing structural isolation to avoid cross-session contamination.

Quick Start

Run claude-dev-worktree start <repo> <slug> to create a per-session worktree and then cd to ~/dev/<repo>-<slug> to work.

Frequently Asked Questions about dev-repo-worktrees

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent git HEAD drift when running multiple Claude Code sessions in the same repo?

Git worktrees prevent HEAD drift by giving each concurrent session its own isolated working directory and index at ~/dev/<repo>-<slug>/. This ensures multiple Claude Code sessions can edit the same repo simultaneously without contaminating the main checkout.

What is a per-session git worktree and when do I need one for concurrent development?

A per-session git worktree provides an isolated working directory at ~/dev/<repo>-<slug>/ with its own HEAD and index. You need this when multiple Claude Code sessions concurrently edit the same repository to prevent cross-session contamination.

How do I set up an isolated worktree for a new development session?

Run the wrapper command claude-dev-worktree start <repo> <slug> to create a per-session worktree, then cd into ~/dev/<repo>-<slug>/ to begin working. A hookify warn rule enforces this isolation automatically.

Do I need to install a hook to enforce git worktree isolation across sessions?

Yes, the Skill requires installing a wrapper script and a hookify warn rule wired into your vault. This setup ensures each Claude Code session automatically uses its own worktree at ~/dev/<repo>-<slug>/ rather than editing the main checkout directly.

Can I use git worktrees for multi-repo feature work across several development sessions?

Yes, per-session worktree isolation applies to multi-repo feature work and any edits involving git commits or pushes. It is designed for scenarios where several concurrent Claude Code sessions target ~/dev/<repo> simultaneously.

What's the best way to keep my main git checkout untouched during automated session commits?

The best way to keep the main checkout untouched is to isolate session edits in a dedicated worktree at ~/dev/<repo>-<slug>/. This structural isolation ensures the main checkout remains pristine and free from automated commit drift.