create-worktree
Skill1 starsChanged 49 days agoMITView on GitHub
Creates an isolated git worktree under `.worktree/<branch>` at the project root, copies the files or directories listed in `.worktreeinclude` into the new worktree, and resolves the branch name from user input, an issue (gh/glab), or a clarifying question. Use when asked to create a worktree, add a sibling checkout, or start work in an isolated branch.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- lyz52789/claude-skillstheir own version, first seen Oct 9, 2026
- timeplus-io/protontheir own version, first seen Oct 8, 2026
- dlt-hub/dlttheir own version, first seen Oct 8, 2026
- ClickHouse/ClickHousetheir own version, first seen Oct 8, 2026
- YoniChechik/claude-code-configtheir own version, first seen Sep 18, 2026
- oligot/claude-skillstheir own version, first seen Jun 24, 2026
Used with
Projects with it also use review.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SentrySkillreview
Fixture review skill.
Also in 3 projects that use this
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- ClickHouse/ClickHouse★ 51ksame name
- dlt-hub/dlt★ 6.1ksame name
- timeplus-io/proton★ 2.3ksame name
- shikajiro/claude-code-skill-example★ 64same name
- lyz52789/claude-skills★ 0same name
- oligot/claude-skills★ 0same name
- YoniChechik/claude-code-config★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository24 other files it gives its agents.
- accessing-microsoft-learn-docsSkill
- architecture-validatorSkill
- autonomous-researcherSkill
- clean-up-stale-inline-review-notesSkill
- create-artifactsSkill
- github-check-pr-review-comments-graphqlSkill
- github-create-draft-prSkill
- github-creating-issuesSkill
- github-replying-to-pr-threadsSkill
- github-sub-issue-creatorSkill
- gitlab-check-mr-review-commentsSkill
- gitlab-create-issueSkill
- gitlab-create-mrSkill
- gitlab-reply-mr-threadsSkill
- gitlab-sub-issue-linkerSkill
- hypothesis-driven-planningSkill
- japanese-writingSkill
- load-inline-review-notesSkill
- operating-gitSkill
- operating-jetbrains-projectsSkill
- referencing-commit-conventionSkill
- rust-coding-conventionsSkill
- sequential-thinkingSkill
- web-artifacts-builderSkill
The file
Files
create-worktree
プロジェクトルート直下の .worktree/ に git worktree を作成する。worktree のフォルダ名はブランチ名をそのまま使用する。.worktreeinclude が存在する場合は、そこに記載されたファイルまたはフォルダを bash シェルで新 worktree へコピーする。作成完了後はディレクトリのパスをユーザーに報告する。
1. ブランチ名の決定
以下の優先順位で決定する。
- ユーザー指定: ユーザーがブランチ名を渡している場合はそれを採用する。
- 自動生成: 指定がない場合、Issue やタスク情報からブランチ名を生成できるなら生成する。
- リモートのホストと利用可能な CLI を確認する。GitHub なら
gh、GitLab ならglabを使用する。 - オープンな Issue を取得する。
- GitHub:
gh issue list --state open --limit 10 --json number,title - GitLab:
glab issue list --opened --per-page 10
- GitHub:
- タスクの文脈に即した Issue を選び、
<番号>-<スラグ>形式でブランチ名を生成する。スラグはタイトルを小文字英数字とハイフンのみに変換したものとする。日本語タイトルの場合は英訳して短いスラグにする。リポジトリの既存慣習に prefix(feat/等)があるなら従う。 - Issue が絞り込めない場合や生成ルールが適用できない場合は手順3へ移る。
- リモートのホストと利用可能な CLI を確認する。GitHub なら
- ユーザーへの質問: 上記どちらも不可能なら、質問ツールでブランチ名を確認する。
生成したブランチ名は必ず git のブランチ名として妥当か検証する。
git check-ref-format "refs/heads/$BRANCH" || echo "invalid branch name: $BRANCH"検証に失敗した場合はユーザーに質問してブランチ名を確定する。
2. 開始地点(ベースブランチ)の決定
main ブランチが存在すればそこを開始地点とする。存在しない場合は現在のブランチ(git branch --show-current)を使う。ユーザー指定があればそれに従う。
if git show-ref --verify --quiet "refs/heads/main"; then
BASE="main"
else
BASE="$(git branch --show-current)"
fi3. 既存ブランチの確認
同名ブランチが既に存在する場合は再利用し、新規作成は行わない。
git branch --list "$BRANCH"4. リポジトリルートの取得と .gitignore の準備
リポジトリルートで作業する。.worktree/ は git の管理対象外にするため、.gitignore に無ければ追記する。
ROOT="$(git rev-parse --show-toplevel)"
cd "$ROOT"
if [ -f .gitignore ] && ! grep -qxF '.worktree/' .gitignore; then
printf '\n# git worktrees\n.worktree/\n' >> .gitignore
fi5. worktree の作成
新規ブランチの場合は -b を付けて作成し、既存ブランチの場合は -b を付けずにチェックアウトする。
# 新規ブランチ
git worktree add -b "$BRANCH" "$ROOT/.worktree/$BRANCH" "$BASE"
# 既存ブランチの再利用
# git worktree add "$ROOT/.worktree/$BRANCH" "$BRANCH"注意:
- パスは絶対パスで指定する。
- ブランチ名に
/が含まれる場合(feat/9-foo等)は、.worktree/配下でフォルダとしてネストされる。フォルダ名はブランチ名そのままという要件を満たす。 - 既存ブランチを再利用する場合は、その旨をユーザーに伝える。
6. .worktreeinclude のファイルコピー
.worktreeinclude が存在する場合、各エントリ(ファイルまたはフォルダ)をリポジトリルートからの相対パスとして新 worktree へコピーする。bash で実装する。
if [ -f "$ROOT/.worktreeinclude" ]; then
TARGET="$ROOT/.worktree/$BRANCH"
while IFS= read -r entry || [ -n "$entry" ]; do
case "$entry" in
'' | \#*) continue ;;
esac
if [ -e "$ROOT/$entry" ]; then
PARENT="$(dirname "$entry")"
mkdir -p "$TARGET/$PARENT"
cp -r "$ROOT/$entry" "$TARGET/$PARENT"
else
echo "warning: $entry does not exist, skipped"
fi
done < "$ROOT/.worktreeinclude"
fi.worktreeinclude の書式は 1 行に 1 エントリである。空行と # で始まる行は無視する。
AGENTS.md
.agents/skills
conductor/7. 検証と報告
worktree の作成結果を確認する。
git worktree list作成完了後、以下をユーザーに報告する。
- worktree のディレクトリパス:
$ROOT/.worktree/$BRANCH - ブランチ名と開始地点
.worktreeincludeからコピーしたファイルまたはフォルダの一覧(コピー対象があった場合)- スキップされたエントリ(存在しなかった場合)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

