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

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…

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.

Root Cause

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.

Fix Action

Workaround

None found. /clear and start fresh.

Code Example

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, ... }
RAW_BUFFERClick to expand / collapse

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.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING