git-worktrees

git-worktrees is a skill for Claude Code, Codex from Insajin/autopus-adk. It costs 18 tokens per session (588 once invoked), scanned A, original, MIT.

A guide to Git worktrees, which let you check out and work on multiple branches in separate directories at the same time. It includes patterns for isolating parallel coding-agent work.

In plain words
What is it for?
Use it for parallel feature development, urgent fixes, pull-request reviews, and isolated frontend, backend, or testing work.
Why use it?
It reduces file conflicts when several branches, agents, or tasks need to run concurrently. Each worktree provides an independent working directory while sharing the repository's Git data.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is git worktree add ../project-feature feature/new-feature.

Good fit Use it for parallel feature development, urgent fixes, pull-request reviews, and isolated frontend, backend, or testing work.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/Insajin/autopus-adk
agentmods
npx agentmods add skills/insajin/autopus-adk/git-worktrees

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for git-worktrees

README.md
[![agentmods](https://agentmods.dev/badge/skills/insajin/autopus-adk/git-worktrees/github.svg)](https://agentmods.dev/skills/insajin/autopus-adk/git-worktrees)
Your own site
<a href="https://agentmods.dev/skills/insajin/autopus-adk/git-worktrees"><img src="https://agentmods.dev/badge/skills/insajin/autopus-adk/git-worktrees/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for git-worktrees

Your own site · 80×15
<a href="https://agentmods.dev/skills/insajin/autopus-adk/git-worktrees"><img src="https://agentmods.dev/badge/skills/insajin/autopus-adk/git-worktrees.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 588 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00018 $0.00588
Opus 5.5 $0.00007 $0.00235
Sonnet 5.5 $0.00004 $0.00118
Haiku 4.5 $0.00002 $0.00059

Measured 2mo ago against content hash 26d3f6df2865, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

git-worktrees scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.omp/skills/git-worktrees/SKILL.md · 87 lines

What it actually says

Git Worktrees Skill

Git Worktree를 사용하여 여러 브랜치를 동시에 작업하는 스킬입니다.

Git Worktree 기본

# 새 worktree 생성 (브랜치 자동 생성)
git worktree add ../project-feature feature/new-feature

# 기존 브랜치로 worktree 생성
git worktree add ../project-hotfix hotfix/critical-fix

# worktree 목록 확인
git worktree list

# worktree 제거
git worktree remove ../project-feature
git worktree prune  # 정리

에이전트 격리 패턴

코딩 에이전트의 병렬 작업을 격리할 때:

# 에이전트별 독립 worktree 생성
git worktree add /tmp/agent-backend-work agent/backend-$(date +%s)
git worktree add /tmp/agent-frontend-work agent/frontend-$(date +%s)
git worktree add /tmp/agent-tester-work agent/tester-$(date +%s)

각 에이전트는 자신의 worktree에서:

  • 독립적으로 파일 수정
  • 파일 충돌 없이 병렬 실행
  • 완료 후 메인 브랜치에 머지

Worktree 워크플로우

기능 개발 + 핫픽스 동시 진행

# 현재 기능 개발 중
git worktree add ../hotfix hotfix/security-patch

# 핫픽스 worktree에서 작업
cd ../hotfix
# 수정...
git commit -m "fix(security): XSS 취약점 수정"
git push origin hotfix/security-patch

# 원래 작업으로 복귀
cd ../main-project

코드 리뷰 동시 진행

# PR 브랜치를 worktree로 체크아웃
git worktree add ../review-pr-123 pr-review/123
git fetch origin pull/123/head:pr-review/123

주의 사항

  • 같은 브랜치를 두 개의 worktree에서 사용 불가
  • .git/ 디렉토리는 공유됨 (커밋, 스테이지 독립)
  • Worktree 경로에 공백 사용 피할 것
  • 에이전트 작업 완료 후 반드시 제거

정리 스크립트

#!/bin/sh
# 오래된 에이전트 worktree 정리
git worktree list --porcelain | \
  grep "^worktree " | \
  grep "/tmp/agent-" | \
  awk '{print $2}' | \
  xargs -I{} git worktree remove {}
git worktree prune
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 87 lines · 18 tokens per session scan A 26d3f6df2865

Subscribe to this mod's changes

git-worktrees is a skill published in the GitHub repository Insajin/autopus-adk (111 stars, last pushed 1mo ago), licensed MIT. It adds 18 tokens to every session and 588 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

git-worktrees compared with skills from other repositories

git-worktrees next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
git-worktreesInsajin/autopus-adkSkill1111mo agoMITA18Claude Code, Codex
agent-framework-py-releasemicrosoft/agent-frameworkSkill15kyesterdayMITA102Claude Code, Codex
ghbubbuild/bubSkill1.7kyesterdayApache-2.0A96Claude Code, Codex
git-workflowericrisco/rsc-harnessSkill5032d agoMITA127Claude Code, Codex
ship-itBlackBeltTechnology/pi-agent-dashboardSkill3412d agoMITA92Claude Code, Codex
release-cutBlackBeltTechnology/pi-agent-dashboardSkill3412d agoMITA93Claude Code, Codex
release-revokeBlackBeltTechnology/pi-agent-dashboardSkill3412d agoMITA85Claude Code, Codex