Skip to content

Restore‑ShpChat

Raimund edited this page Sep 25, 2026 · 1 revision

SYNOPSIS

Loads a stored checkpoint back into the running Session chat, without replaying anything.

SYNTAX

Restore-ShpChat [-Path] <String> [[-CheckpointId] <String>] [[-Rollback] <Int32>] [-Fork]
 [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

Resumes, rolls back, or forks a conversation saved with Save-ShpChat. The checkpoint's turns replace the Session chat, and the model that produced them is restored alongside, so Compress-ShpChat and the Context guard size themselves against the right window.

NOTHING IS REPLAYED. A checkpoint holds completed user/assistant turns and nothing else, so there is no Tool call to re-issue - and any side effect recorded on the checkpoint as uncertain, because its Turn never completed, is REPORTED rather than repeated. Re-running a write or a command on someone's behalf during a resume is the one thing a resume must never do: the caller cannot see it happen, and half of those calls already succeeded.

A resumed session replays REDACTED history, because redaction is applied on write. The model may therefore answer differently than it did the first time.

After a restore, the next Save-ShpChat chains its checkpoint to the one restored. Restoring an older checkpoint and saving is therefore a fork: the later checkpoints stay exactly where they are, and the store grows a second line rather than losing the first.

EXAMPLES

EXAMPLE 1

Restore-ShpChat -Path ./review-session.json

Continues yesterday's conversation in this session.

EXAMPLE 2

Restore-ShpChat -Path ./review-session.json -Rollback 2

Goes back two checkpoints and continues from there.

EXAMPLE 3

Restore-ShpChat -Path ./review-session.json -CheckpointId $id -Fork

Starts an alternative line from a named checkpoint, keeping the original one intact.

PARAMETERS

-CheckpointId

The checkpoint to load. Defaults to the newest one in the store.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Fork

State that the restore begins a new line. It changes no stored data - a fork is what saving from a restored older checkpoint already does - and exists so the intent is visible in a script and in the report.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Path

The store file to read. Mandatory, always; there is no default.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Rollback

Walk back this many checkpoints along the parent chain from the newest (or from -CheckpointId) and load that one instead.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

System.Management.Automation.PSCustomObject

A ShellPilot.ChatRestore: CheckpointId, ParentCheckpointId, Label,

Path, Turns, Model, Revision, Forked and UncertainSideEffects.

NOTES

RELATED LINKS

Save-ShpChat

Get-ShpChatCheckpoint

Clear-ShpChat

Clone this wiki locally