#2968·gstack

/autoplan phase guard denies every phase in sessions with SessionStart hooks (transcript reads as 'missing')

Author: maydaycyberCreated Sep 24, 2026Updated Sep 24, 2026

Summary

In any Claude Code session that has SessionStart hooks configured, /autoplan refuses every phase entry with:

[autoplan] Native parent evidence has not reached the journal yet. Retry this phase-entry tool; no missing-publication conclusion has been made.

Retrying never helps, because the transcript is never considered owned. readOwnedClaudePublicTranscript returns status: 'missing' with 0 events for the live session.

Root cause

lib/claude-public-transcript.ts roots session ownership at the first user message whose parentUuid is null. With SessionStart hooks, Claude Code writes message-less attachment records to the journal before the first user turn:

{"type":"attachment","uuid":"ab33…","parentUuid":null,"attachment":{"type":"hook_success"}}
{"type":"attachment","uuid":"dfc2…","parentUuid":"ab33…","attachment":{"type":"hook_success"}}
{"type":"attachment","uuid":"5b9f…","parentUuid":"dfc2…","attachment":{"type":"hook_additional_context"}}
{"type":"user","uuid":"…","parentUuid":"5b9f…","promptSource":"typed", …}
  • ownedCausalLines walks up from the first conversation node to the attachment head. It then rejects the session because that root has no user message (root.record.message.role !== 'user').
  • readPlanCountTranscript only adds an ancestry root when the first user message has parentUuid === null, so it never roots either.

The result is status: 'missing', and the publication hook fails closed on every guarded Read/Agent. Fresh sessions don't help, because the hooks fire on every session start.

Fix

Treat an unbroken, message-less attachment chain (null-parent head, same session/cwd, isSidechain: false, no agentId) that ends directly at the first user turn as that turn's preamble. That needs two small changes, one in ownedCausalLines and one in readPlanCountTranscript. Competing-root, cyclic, foreign-cwd, sidechain and agent checks are unchanged. PR incoming with a regression test (positive case plus 5 fail-closed variants).

Environment: gstack v1.89.0.0, Claude Code on Linux, SessionStart hooks from plugins.