Use when implementation is complete, all tests pass, and you need to decide how to integrate the work — guides completion of development work by presenting structured options for merge, PR, or cleanup
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use when implementation needs isolation from the current workspace; creates git worktrees with safe directory selection and baseline verification.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
설치 방법 보기설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
Create isolated workspace: detect directory → verify gitignored → create worktree → install deps → verify tests pass. Use $worktree or $isolate to activate. Pairs with $finish for cleanup.
$codex-git-worktrees, $worktree, or $isolate.codex-subagent-execution starts (recommended prereq).Announce at start: "I'm using codex-git-worktrees to set up an isolated workspace."
Follow this priority order:
# Check in priority order (cross-platform)
ls -d .worktrees 2>/dev/null # Preferred (hidden)
ls -d worktrees 2>/dev/null # Alternative
# PowerShell (Windows)
Test-Path .worktrees
Test-Path worktrees
If found: Use that directory. If both exist, .worktrees wins.
# Check .codex/context/genome.md or project README for worktree preferences
grep -i "worktree" .codex/context/genome.md 2>/dev/null
If preference specified: Use it without asking.
If no directory exists and no config preference:
No worktree directory found. Where should I create worktrees?
1. .worktrees/ (project-local, hidden)
2. worktrees/ (project-local, visible)
Which would you prefer?
MUST verify directory is ignored before creating worktree:
# Bash/macOS/Linux
git check-ignore -q .worktrees 2>/dev/null
echo $? # 0 = ignored (safe), 1 = NOT ignored (fix needed)
# PowerShell (Windows)
git check-ignore -q .worktrees 2>$null
$LASTEXITCODE # 0 = ignored (safe), 1 = NOT ignored (fix needed)
If NOT ignored:
Fix immediately:
.gitignore# Bash
echo ".worktrees/" >> .gitignore
git add .gitignore
git commit -m "chore: add .worktrees to gitignore"
# PowerShell
Add-Content .gitignore ".worktrees/"
git add .gitignore
git commit -m "chore: add .worktrees to gitignore"
Why critical: Prevents accidentally committing worktree contents to repository.
# Bash
project=$(basename "$(git rev-parse --show-toplevel)")
echo "Project: $project"
# PowerShell
$project = Split-Path (git rev-parse --show-toplevel) -Leaf
Write-Output "Project: $project"
# Create worktree with new branch
git worktree add ".worktrees/$BRANCH_NAME" -b "$BRANCH_NAME"
cd ".worktrees/$BRANCH_NAME"
Auto-detect and run appropriate setup:
# Node.js
if [ -f package.json ]; then npm install; fi
# Python
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then pip install -e .; fi
# PowerShell equivalents
if (Test-Path package.json) { npm install }
if (Test-Path requirements.txt) { pip install -r requirements.txt }
if (Test-Path pyproject.toml) { pip install -e . }
if (Test-Path Cargo.toml) { cargo build }
if (Test-Path go.mod) { go mod download }
if (Test-Path *.csproj) { dotnet restore }
Run tests to ensure worktree starts clean:
# Use project-appropriate command
npm test / python -m pytest / cargo test / go test ./...
If tests fail: Report failures, ask whether to proceed or investigate. If tests pass: Report ready.
Worktree ready at <full-path>
Branch: <branch-name>
Tests passing (<N> tests, 0 failures)
Ready to implement <feature-name>
When work is complete, present options:
Implementation complete. What would you like to do?
1. Merge back to <base-branch> locally
2. Push and create a Pull Request
3. Keep the branch as-is (I'll handle it later)
4. Discard this work
git checkout <base-branch>
git pull
git merge <feature-branch>
# Verify tests
git branch -d <feature-branch>
git worktree remove <worktree-path>
git push -u origin <feature-branch>
# Create PR via gh/git platform
Keep worktree for follow-up work.
Report: "Branch preserved at <path>."
Confirm first with typed confirmation.
git checkout <base-branch>
git branch -D <feature-branch>
git worktree remove <worktree-path>
| Situation | Action |
|---|---|
.worktrees/ exists | Use it (verify ignored) |
worktrees/ exists | Use it (verify ignored) |
| Both exist | Use .worktrees/ |
| Neither exists | Check config → Ask user |
| Directory not ignored | Add to .gitignore + commit |
| Tests fail during baseline | Report failures + ask |
| No package.json/Cargo.toml | Skip dependency install |
| Mistake | Problem | Fix |
|---|---|---|
| Skip ignore verification | Worktree tracked in git | Always git check-ignore first |
| Assume directory location | Inconsistency with project | Follow priority: existing > config > ask |
| Proceed with failing tests | Can't distinguish new vs old bugs | Report failures, get permission |
| Hardcode setup commands | Breaks on different projects | Auto-detect from project files |
| No test baseline | Don't know if worktree is clean | Always run tests after setup |
$worktree → create isolated branch → $sdd → execute plan → $finish
# Auto-commit within worktree
python codex-git-autopilot/scripts/auto_commit.py --project-root <worktree-path>
# Verify before merging back
python codex-execution-quality-gate/scripts/auto_gate.py --mode full --project-root <worktree-path>
codex-subagent-execution — Execute plan tasks within isolated worktreecodex-git-autopilot — Commit automation within worktreecodex-execution-quality-gate — Verify before merge/PRcodex-plan-writer — Creates the plan to execute in worktree아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work — guides completion of development work by presenting structured options for merge, PR, or cleanup
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use when a project has 50+ files, missing context, or explicit $codex-genome request; generates multi-layer project context to reduce hallucination.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use for DESIGN.md visual identity contracts; author, scaffold, lint, diff, and export design contracts with the upstream spec and CLI.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use when the task involves reading, creating, or editing `.docx` documents, especially when formatting or layout fidelity matters; prefer `python-docx` plus the bundled `scripts/render_docx.py` for visual checks.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use when code changes may require documentation updates; maps git diff to candidate docs without auto-editing documentation.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use for documents, reports, memos, guides, academic papers, or formal text that needs clear structure, reliable tone, formatting, and diagrams.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.