# Rewrite Checkpoints: Faithful Prompt + Metadata Replay (Review)

`2d7a8df` ·  
  
Soph · 1w ago · 1 file · +13 added / -1 removed

- Split the stored prompt blob back into the original prompt list via SplitPromptContent instead of wrapping it in a one-element slice — so an empty prompt file stays empty and RedactedJoinedPrompts reconstructs the original prompts (and count) rather than re-redacting the joined text. [cursor]
- Forward the remaining session-level fields the replay dropped — Attribution, PromptAttributions, SessionMetrics, Kind, ReviewPrompt/Skills, Investigate run/topic, and the root HasReview/HasInvestigation flags — so a rewritten ref matches the branch checkpoint the tool evaluates. [cursor]

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

## Sessions  
78d184424eb8 View transcript

## Changes

1

- cmd/entire/cli/checkpoint
  
  - Mrewrite.go +13 / -1

```
184 unmodified lines

185
186
187
188
188
189
190
191
6 unmodified lines

198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215

184 unmodified lines

Strategy:                    m.Strategy,
            Branch:                      m.Branch,
            Transcript:                  redact.AlreadyRedacted(content.Transcript),
            Prompts:                     []string{content.Prompts},
            Prompts:                     SplitPromptContent(content.Prompts),
            FilesTouched:                m.FilesTouched,
            CheckpointsCount:            m.CheckpointsCount,
            SaveStepCount:               m.SaveStepCount,
6 unmodified lines

CheckpointTranscriptStart:   m.CheckpointTranscriptStart,
            TokenUsage:                  m.TokenUsage,
            SkillEvents:                 m.SkillEvents,
            // Forward the remaining session-level fields so a rewritten ref
            // matches the branch checkpoint the tool is meant to evaluate.
            Attribution:            m.Attribution,
            PromptAttributionsJSON: m.PromptAttributions,
            SessionMetrics:         m.SessionMetrics,
            Kind:                   m.Kind,
            ReviewPrompt:           m.ReviewPrompt,
            ReviewSkills:           m.ReviewSkills,
            InvestigateRunID:       m.InvestigateRunID,
            InvestigateTopic:       m.InvestigateTopic,
            HasReview:              summary.HasReview,
            HasInvestigation:       summary.HasInvestigation,
        })); err != nil {
            return fmt.Errorf("write session %d: %w", idx, err)
        }
```

Mcmd/entire/cli/checkpoint/rewrite.go +13 / -1
