本文へ移動
cccskills
無料GitHub で公開

worktree

Create and manage git worktrees for parallel agent sessions

インストール方法を見る

含まれるファイル(1)

  • SKILL.md2.7 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Worktree Management

Manage git worktrees for parallel Claude Code sessions and subagent dispatch.

Commands

CommandUsagePurpose
/worktree create <slug>Create a new worktreeIsolated workspace for parallel work
/worktree listList active worktreesSee what's running
/worktree merge <slug>Merge and clean upBring work back to main
/worktree cleanup <slug>Remove without mergingAbandon a worktree

Execution

All commands delegate to .claude/scripts/worktree-manager.sh:

.claude/scripts/worktree-manager.sh <command> [slug]

IMPORTANT: The script operates on the vault root. Always run from the vault directory. Use dangerouslyDisableSandbox: true because worktrees are created outside the vault directory (sibling path).

Slug Rules

  • Lowercase alphanumeric with hyphens: meeting-notes-batch, architecture-review
  • Becomes the branch name: worktree/<slug>
  • Becomes the directory name: ../<vault>-worktrees/<slug>/

Dispatching Subagents to Worktrees

After creating a worktree, dispatch subagents with the worktree path as their working directory:

1. Create worktree: /worktree create meeting-notes-batch
2. Note the path from output (e.g. /Users/.../BA-DavidOliver-ObsidianVault-worktrees/meeting-notes-batch)
3. Dispatch subagent with Task tool, including in the prompt:
   "Work in /Users/.../BA-DavidOliver-ObsidianVault-worktrees/meeting-notes-batch"
4. When subagent completes: /worktree merge meeting-notes-batch

Multi-Session Usage

For separate Claude Code terminals working in parallel:

  1. Session A: /worktree create feature-alpha → opens terminal in worktree path
  2. Session B: /worktree create feature-beta → opens terminal in worktree path
  3. Each session works independently
  4. When done: /worktree merge feature-alpha (from the main vault session)

Conventions

  • Branch naming: worktree/<slug> — visually distinct in git log
  • Merge strategy: --no-ff for clean merge commits
  • Config copied: .claude/ and .mcp.json are copied to each worktree
  • Not copied: .obsidian/ — worktrees are agent workspaces, not Obsidian vaults
  • Location: Sibling directory ../<vault>-worktrees/<slug>/ (outside vault, invisible to Obsidian)

Troubleshooting

IssueFix
"slug required"Provide a slug: /worktree create my-task
Merge conflictsResolve manually in main, then git worktree remove
Sandbox blocks worktree creationUse dangerouslyDisableSandbox: true
Worktree already existsIdempotent — reuses existing worktree

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Batch populate summary fields using content analysis

日本語の概要は準備中です。原文の説明を表示しています。

DavidROliverBA/ArchitectKB532026年3月2日 更新

auto-tag

無料

Batch auto-tag untagged notes using content analysis

日本語の概要は準備中です。原文の説明を表示しています。

DavidROliverBA/ArchitectKB532026年3月2日 更新

Generate C4 architecture diagrams from system notes

日本語の概要は準備中です。原文の説明を表示しています。

DavidROliverBA/ArchitectKB532026年3月2日 更新

canvas

無料

Create and edit Obsidian Canvas files for architecture visualization

日本語の概要は準備中です。原文の説明を表示しています。

DavidROliverBA/ArchitectKB532026年3月2日 更新

Check Outlook inbox and update daily note with message summary

日本語の概要は準備中です。原文の説明を表示しています。

DavidROliverBA/ArchitectKB532026年3月2日 更新

commit

無料

Stage and commit vault changes with UK English conventional commit messages

日本語の概要は準備中です。原文の説明を表示しています。

DavidROliverBA/ArchitectKB532026年3月2日 更新

DavidROliverBA のスキルをすべて見る

このスキルの問題を報告する