[BUG] /rewind: "Can't rewind to this message" when target user-prompt's parent is a SessionStart-hook system row (v2.1.138 CLI)
Summary
Selecting any anchor in the /rewind picker returns "Can't rewind to this message" when the user-prompt anchor's direct parentUuid resolves to a type=system row generated by a SessionStart hook. The picker still presents these anchors as selectable.
This narrows #57601 (general CLI "all anchors un-rewindable" bug, v2.1.119, still OPEN) and complements #57206 (Desktop variant, closed not-planned, traced to plugin Stop hook injection). This issue covers the SessionStart hook + CLI variant with JSONL-level repro.
Environment
- Claude Code: 2.1.138 (CLI, global install)
- OS: macOS Darwin 23.1.0
- Shell: zsh
- Hardware: Apple Silicon
Hooks configured (in ~/.claude/settings.json)
SessionStart— multiple commands; the relevant one injects harness context as conversation system contentPreToolUse,PostToolUse,UserPromptSubmit,PreCompact— present but not on the failing path
Repro
- Configure a
SessionStarthook in~/.claude/settings.jsonwhose output is injected as harness context. - Start a fresh CLI session with that hook active.
- Submit 2–3 user prompts. Use any tools (Bash, Agent). No MCP needed.
- Press
Esc Escto open the rewind picker — anchors render normally. - Select any anchor.
- Popup: "Can't rewind to this message".
100% reproducible across sessions on this CLI version.
JSONL evidence
In ~/.claude/projects/<project>/<session>.jsonl, the user-prompt row that fails to rewind has this immediate ancestry:
row N-1 type=system uuid=<X> parent=<prev assistant uuid>
metadata: { hookInfos, hookCount, preventedContinuation, ... }
row N type=user uuid=<Y> parent=<X> ← anchor target
metadata: { promptId, isSidechain:false, ... }
Walking parentUuid backward from the current head, <Y> IS in the ancestor chain — confirmed by walking the chain in a script. So this is not a missing-message / not-on-active-chain problem (rules out #59697).
Hypothesis
The rewind anchor validator rejects user-prompt anchors whose parentUuid resolves to a hook-generated type=system row.
If true:
- Either the validator should accept these (the system row is a legitimate ancestor and was on the active chain at prompt-submit time), or
- The picker should grey out / hide these anchors so users aren't shown selectable options that always fail (this is also #57601's UX request).
The connection to #57206 supports the hook-injection hypothesis: that issue traced the Desktop variant to plugin Stop hook injection. This issue is the same family but at a different hook surface (SessionStart) and on a different transport (CLI).
Related
- #57601 — general CLI variant of the popup, v2.1.119, still OPEN. This narrows scope.
- #57206 — Desktop variant, traced to plugin Stop hook injection. Closed not-planned. Same family, different hook surface.
- #58460 — long-session + MCP disconnects. Ruled out (short session, no MCP).
- #59697 — "not on active chain (chain size N/M)". Ruled out (chain is intact, target IS in ancestor set).
Workaround
None found. /clear and start fresh.
Suggested fix paths
- Validator fix: treat
type=systemparents (especially hook-generated ones withhookInfosmetadata) as valid in the rewind ancestry walk. - Picker fix: during picker render, run the same validation that selection runs, and grey out / hide anchors that would be rejected. (Per #57601 UX request.)
- Both — most defensive.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗