Skip to main content

parallel-subagent-git-worktree-race

Fix/avoid HEAD+index corruption when running parallel Claude Code subagents (Agent tool) that each mutate git (checkout/rebase/reset) in what you THOUGHT were isolated worktrees. Use when: (1) you spawned 2+ agents with isolation:"worktree" to rebase/merge/commit different branches concurrently; (2) an agent reports "I am NOT in an isolated worktree" — `git rev-parse --git-dir` and `--git-common-dir` both point at the same `.git`, `git worktree list` shows a SINGLE worktree, and `--show-toplevel` is the main checkout; (3) a rebase suddenly appears to be running on the WRONG branch, or the reflog shows a branch reset/checkout you didn't issue during your run; (4) two agents' `git checkout` calls swap HEAD/index underneath each other. Covers detection, the serialize-to-one-owner recovery, and a ref-recheck guard pattern.

インストールへ移動

ソース情報

リポジトリ
cajias/claude-skills
ソースの最終更新活動
2026年7月20日 07:29
検出された SKILL.md の言語
英語
スター
0
フォーク
0

インストール方法

デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。

ソースファイルを確認

インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。