← ClaudeAtlas

subagent-driven-branch-ref-froze-stranded-commitslisted

Diagnose and recover from "PR merged, but half my work is missing from main" cases in `superpowers:subagent-driven-development` (or similar one-fresh- subagent-per-task) sessions, where committed work survives in the worktree's `HEAD` chain but never makes it into the pushed branch ref. Use when ANY of these appears: (1) `gh pr view <N>` body claims "M files changed, N insertions" but `gh pr diff <N> --name-only | wc -l` returns a smaller number than you expect (canary: PR-body file count > actual squash-commit file count), (2) the merged squash commit on main is MISSING entire files you remember creating (Dockerfile, route handler, deploy artefact, etc.) — and you wrote AND committed them per the subagent reports, (3) `git rev-parse HEAD` ≠ `git rev-parse <feature-branch>` in the worktree (HEAD is ahead), (4) `git reflog show <feature-branch>` ends earlier than `git log --oneline` on the same worktree (reflog gap = stranded zone), (5) tests that passed locally during the session now fail on main because file
wan-huiyan/agent-traffic-control · ★ 2 · AI & Automation · score 79
Install: claude install-skill wan-huiyan/agent-traffic-control
# Subagent-driven session left commits stranded — branch ref froze while worktree HEAD advanced ## Problem You ran a long `superpowers:subagent-driven-development` (or similar fresh- subagent-per-task) session in a worktree. Each subagent did its task, committed its work, the controlling session ran spec + code-quality review per task, all green. At the end you pushed the worktree's branch to origin, opened a PR, CI went green, you squash-merged. Hours or one session later, somebody runs `pytest` on freshly-pulled main and gets a `ModuleNotFoundError`, a missing-file assertion, or a `sql_path missing` error pointing at code that **was definitely committed** during the session. `git log` in your old worktree still shows all the commits at the top of the branch. But on main, half of them are gone. The squash commit on main contains only the early portion of your work — typically the first N tasks before some specific transition point. Tasks after that point exist as commits in the worktree (`git log` shows them) but did not reach origin, did not reach the PR, did not reach the merge. ## Context / Trigger Conditions Strong signal **after** the merge: 1. `gh pr view <N>` body claims a file count (e.g. "55 files changed") that doesn't match the actual squash-commit file count (`git diff-tree --no-commit-id --name-only -r <merge-sha> | wc -l`). 2. A test that passed locally during the session now fails on main because a file the test depends on isn't there. 3. Recei