[BUG] /rewind: "Can't rewind to this message" when target user-prompt's parent is a SessionStart-hook system row (v2.1.138 CLI)

Resolved 💬 3 comments Opened May 17, 2026 by jimmyliu-homee Closed May 20, 2026

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 content
  • PreToolUse, PostToolUse, UserPromptSubmit, PreCompact — present but not on the failing path

Repro

  1. Configure a SessionStart hook in ~/.claude/settings.json whose output is injected as harness context.
  2. Start a fresh CLI session with that hook active.
  3. Submit 2–3 user prompts. Use any tools (Bash, Agent). No MCP needed.
  4. Press Esc Esc to open the rewind picker — anchors render normally.
  5. Select any anchor.
  6. 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

  1. Validator fix: treat type=system parents (especially hook-generated ones with hookInfos metadata) as valid in the rewind ancestry walk.
  2. 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.)
  3. Both — most defensive.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗