`/kk-coding` handoff verifier fails silently when previous session's wrap-up commits live on a non-main branch (cross-branch state blindness)
Description
When a Claude Code session starts cold and runs a /kk-coding-style skill that reads project documents from the working tree, it reads ProjectSessionLog-*.md from whatever branch is currently checked out. If the previous session's wrap-up commits landed on a non-main branch (e.g., a long-lived session-NN/paperwork-... branch) and the user is checked out to main, the verifier reports "Section 7 BOOTSTRAP missing" — but provides no recovery path. The user has no way to know that the live state exists on another branch unless they manually run git log --all and notice.
This is a silent state-loss failure mode across cold-start sessions. In a real RISM project case, 13 consecutive session wrap-ups accumulated on a side branch without anyone (Claude or user) noticing the pattern. From main, the project log appeared stuck three weeks in the past.
Expected behavior
When the handoff verifier reports a gap on the working tree, it should at minimum:
- Run
git log --all --oneline -- ProjectSessionLog-*.mdand surface other branches with newer commits to that file. - Suggest the most likely recovery action explicitly: "the most recent SessionLog commit is on branch
<X>, dated<Y>. Read viagit show <X>:ProjectSessionLog-RISM.mdto recover state." - Optionally: warn when the same branch has been the active wrap-up target for N consecutive sessions, suggesting the user merge to main.
Actual behavior
The verifier reports "FAIL: Section 1/7 missing" with no cross-branch awareness. The user must manually investigate. Across 13 sessions of drift on the same project, no agent or skill flagged the pattern.
Reproduction steps
- Create a new branch off main:
git checkout -b session-99/paperwork-test - Commit a
/kk-wrap-up-style artifact with a complete Section 7 BOOTSTRAP block toProjectSessionLog-*.md. - Without merging to main, switch back:
git checkout main - Run
/clearthen/kk-coding. - Observe: the handoff verifier fails. No mention of the side branch where the wrap-up actually exists. No recovery suggestion.
Environment
- Claude Code CLI on macOS Darwin 25.3.0 (and likely all platforms)
- User-installed
~/.claude/skills/kk-coding/SKILL.mdv2.1 - Helper script
~/.claude/scripts/handoff-completeness-check.sh - Model: Opus 4.7 (1M context); behavior likely identical across Sonnet 4.6 and Haiku 4.5
Severity
High. Silent state loss across cold-start sessions is a high-trust failure. User trust degrades each time the agent says "I don't know what we were working on" when in fact the agent could have known by checking other branches.
Suggested fix scope
Either:
- Add cross-branch awareness to
handoff-completeness-check.shrecipe (~50 lines of bash, low risk). - Document a recipe pattern in Claude Code docs for handoff verifiers to include cross-branch checks.
- Add a built-in
claude-code session-recovercommand that does the cross-branch search.
Real-world severity evidence
In RISM Session 89 (2026-05-05), the user ran /kk-coding and the verifier reported "Section 7 missing." The actual live state was on branch session-76/paperwork-enh-034-phase-slot at commit e336645 (Session 88 BOOTSTRAP redirect from earlier the same day). The user had to manually invoke git log --all to discover this. 13 wrap-ups had accumulated on that branch without merging to main.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗