Worktree Safety
Use this skill when the user task touches Git worktrees, multiple adjacent repositories, or a meta-workspace that is not itself a repo.
Workflow
- Identify the real repository before running Git commands:
git rev-parse --show-toplevelgit worktree listwhen relevant
- Distinguish normal repos from pointer directories and wrapper workspaces.
- Do not run root-level Git commands from
/Users/yangshu/Codex; it is a meta-workspace, not a repository. - When a linked worktree exists, assume branch and checkout operations can affect another active checkout.
- If the task is only about Codex config or AGENTS files, edit the intended repo directly and avoid unrelated branch manipulation.
- Verify with repository-local Git commands after edits.
Local context
/Users/yangshu/Codex/codex-worktree-baseis a real repo that hosts a persistent worktree./Users/yangshu/Codex/projects/codex-mainis a normal local repo./Users/yangshu/Codex/projects/codex-headand/Users/yangshu/Codex/codex-worktree-headare worktree-related locations and should not be treated like independent repos without checking first.