What problem does it solve? Agents can accidentally switch branches, stash work, or run destructive git commands in the primary checkout, destroying in-progress work. This Skill pins the agent to one branch and enforces the lock through self-contained pre-tool hooks. ## Core Features & Use Cases - Branch Locking: Set, change, or clear a branch lock through the bundled CLI, which performs an atomic relock-then-switch so the hook never blocks the requested change. - Pre-Tool Hook Enforcement: Claude Code PreToolUse(Bash) and Codex plugin hooks intercept git checkout, switch, stash, clean -f, reset --hard, and whole-tree restore commands in the primary checkout. - Unconditional Primary Guard: Once the dev plugin is enabled, the agent can never move the primary checkout's branch, while isolated worktrees under .red/tmp/ lanes stay exempt. - Use Case: During a long autonomous session on a feature branch, run /branch-lock to guarantee the agent stays on that branch and cannot shelve or discard the human's parallel WIP in the main checkout. ## Quick Start Ask the agent to lock itself to the current branch by running the branch-lock CLI set command, then confirm the lock with the status action.