← ClaudeAtlas

session-handoff-number-collision-with-unmerged-siblinglisted

Detect and recover from a session-number collision when running session-handoff and a parallel/sibling session has authored a same-numbered handoff doc that hasn't merged into main yet. Use when: (1) you're in `session-handoff` Phase 1 about to write `docs/handoffs/session_NNN_handoff.md`, (2) `ls docs/handoffs/` shows the highest number is N-1 (so you pick N), BUT (3) MEMORY.md "Recent sessions" or sessions_archive.md already contains a `session_NNN_*.md` entry pointing at another worktree's branch whose PR hasn't merged. Symptom: you create files that don't collide on disk (the sibling's files live on a separate branch) but DO collide logically — both PRs claim "S167", a future reader can't tell which is which, and any cross-reference to "session_167_*" becomes ambiguous. Defends against the silent-logical-collision class (sister to `barryu-pr-conflict-site-regen` v1.4.0 Step 2c which covers the same shape for tracker IDs). Sister to `feedback_coordination_framing_for_ parallel_artifact_collisions` (proacti
wan-huiyan/agent-traffic-control · ★ 2 · Code & Development · score 79
Install: claude install-skill wan-huiyan/agent-traffic-control
# Session-Handoff Number Collision With Unmerged Sibling ## Problem `session-handoff` Phase 1 Step 2 says "Write handoff doc → `docs/handoffs/session_N_handoff.md`." The implicit assumption is that you can determine N by inspecting `docs/handoffs/` on the current branch. **This assumption breaks when a parallel/sibling session ran concurrently in another worktree and its handoff PR hasn't merged into main yet.** Concrete sequence: 1. Sibling session ran 2 hours ago in `.claude/worktrees/other/`, drafted `session_167_handoff.md`, opened PR #690 (still under review). 2. Sibling session updated MEMORY.md "Recent sessions" with an S167 entry AND appended to sessions_archive.md. 3. You fork your worktree off `origin/main` — MEMORY.md is local-user-state so you see the sibling's S167 entry, but `docs/handoffs/` on `origin/main` does NOT yet have `session_167_handoff.md` (PR pending). 4. You run `ls docs/handoffs/` → highest is S166b → you pick **S167**. 5. You write `docs/handoffs/session_167_handoff.md` + `session_168_prompt.md`. 6. Both sessions now claim S167. Disk doesn't conflict (different branches). MEMORY.md shows two S167 entries. Future readers can't tell which is canonical. The collision is silent because: - `ls` only sees the current branch's files. - `git log origin/main -- docs/handoffs/session_167_handoff.md` returns empty (PR pending). - Pre-commit hooks don't check session-number uniqueness. - The session-handoff skill itself doesn't tell you to cross-check MEM