Path A (detached HEAD in externally managed worktree) was unreachable
because Step 1 halted on test failure before Step 1.5 could detect the
restricted environment. Reorder so detection runs first — Path A now
skips test verification entirely since the toolchain may not be available
in sandbox environments.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Defers $TEMP_DIR expansion to execution time and quotes the variable
inside the trap, protecting against paths with spaces.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests git-dir vs git-common-dir comparison in normal repo, linked
worktree, detached HEAD, and cleanup guard scenarios.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Document the git-dir vs git-common-dir detection pattern and the Codex
App's native finishing flow for skills that need to adapt.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Clarify that using-git-worktrees ensures a workspace exists rather than
always creating one.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Re-detect externally managed worktree at cleanup time and skip removal.
Also fixes pre-existing inconsistency: cleanup now correctly says
Options 1 and 4 only, matching Quick Reference and Common Mistakes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Detect externally managed worktrees with detached HEAD and emit handoff
payload instead of 4-option menu. Includes commit SHA and data loss warning.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8 tasks covering: environment detection in using-git-worktrees,
Step 1.5 + cleanup guard in finishing-a-development-branch,
Integration line updates, codex-tools.md docs, automated tests,
and final verification.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Design for making using-git-worktrees, finishing-a-development-branch,
and subagent-driven-development skills work in the Codex App's sandboxed
worktree environment. Read-only environment detection via git-dir vs
git-common-dir comparison, ~48 lines across 4 files, zero breaking changes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>