claude-code - 💡(How to fix) Fix `/kk-coding` handoff verifier fails silently when previous session's wrap-up commits live on a non-main branch (cross-branch state blindness) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56381Fetched 2026-05-06 06:29:37
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
labeled ×2commented ×1

Error Message

  1. Optionally: warn when the same branch has been the active wrap-up target for N consecutive sessions, suggesting the user merge to main.
RAW_BUFFERClick to expand / collapse

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:

  1. Run git log --all --oneline -- ProjectSessionLog-*.md and surface other branches with newer commits to that file.
  2. Suggest the most likely recovery action explicitly: "the most recent SessionLog commit is on branch <X>, dated <Y>. Read via git show <X>:ProjectSessionLog-RISM.md to recover state."
  3. 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

  1. Create a new branch off main: git checkout -b session-99/paperwork-test
  2. Commit a /kk-wrap-up-style artifact with a complete Section 7 BOOTSTRAP block to ProjectSessionLog-*.md.
  3. Without merging to main, switch back: git checkout main
  4. Run /clear then /kk-coding.
  5. 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.md v2.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.sh recipe (~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-recover command 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.

extent analysis

TL;DR

To fix the silent state-loss issue, add cross-branch awareness to the handoff-completeness-check.sh script to detect and suggest recovery from newer commits on other branches.

Guidance

  • Modify the handoff-completeness-check.sh script to run git log --all --oneline -- ProjectSessionLog-*.md and surface other branches with newer commits to that file.
  • Implement a recovery suggestion mechanism that provides the most likely recovery action, including the branch and date of the most recent SessionLog commit.
  • Consider adding a warning when the same branch has been the active wrap-up target for N consecutive sessions, suggesting the user merge to main.
  • Test the updated script with the provided reproduction steps to verify the fix.

Example

# Example modification to handoff-completeness-check.sh
git log --all --oneline -- ProjectSessionLog-*.md | grep -v main | awk '{print "Recovery suggestion: git show "$1":ProjectSessionLog-RISM.md"}'

Notes

The suggested fix assumes that the handoff-completeness-check.sh script is the primary cause of the issue. Additional testing and verification may be necessary to ensure the fix works as expected.

Recommendation

Apply the workaround by modifying the handoff-completeness-check.sh script to add cross-branch awareness, as this is a low-risk change with a high potential impact on resolving the silent state-loss issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

When the handoff verifier reports a gap on the working tree, it should at minimum:

  1. Run git log --all --oneline -- ProjectSessionLog-*.md and surface other branches with newer commits to that file.
  2. Suggest the most likely recovery action explicitly: "the most recent SessionLog commit is on branch <X>, dated <Y>. Read via git show <X>:ProjectSessionLog-RISM.md to recover state."
  3. Optionally: warn when the same branch has been the active wrap-up target for N consecutive sessions, suggesting the user merge to main.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING