Repository navigation
Save‑ShpChat
Writes the running Session chat to a caller-named store as a new checkpoint.
Save-ShpChat [-Path] <String> [[-Label] <String>] [-Force] [-WhatIf]
[-Confirm] [<CommonParameters>]
Persists the conversation Invoke-Shp continues by default, so it can be resumed in another session, rolled back to an earlier point, or forked into an alternative line. It implements the tier-2 half of decision 002, and the rules that decision settled are the rules here:
- The path is yours. Nothing is discovered, defaulted, or derived from TEMP, the profile, or the working directory. A conversation is the most sensitive thing this module handles, and a store nobody asked for is one nobody knows to delete.
- Redaction is applied on write. The stored turns are redacted turns. A resumed session therefore replays redacted history, and the model may answer differently than it did the first time. That is stated plainly because it is a visible consequence, not a detail.
- Retention is yours. The store only grows. This cmdlet appends and never prunes, rotates, or reclaims; deciding when a stored conversation stops being wanted is not something the module can do on your behalf.
- A schema version is written from the first save and refused rather than migrated when it is not recognised.
Only a DURABLE checkpoint is written. The Session chat holds completed user/assistant exchanges because Invoke-Shp writes it back only on success, so a checkpoint cannot contain an in-flight Tool call - and a conversation that somehow does is refused rather than stored, because resuming from one would mean replaying a Tool call whose outcome nobody knows.
Side effects whose Turn did NOT complete are recorded on the checkpoint as uncertain, and warned about. They are never replayed on resume; they are named so a person can decide what to do about them.
The store records a revision. A save whose store has moved on since this session last saw it is refused as a conflict, so two shells checkpointing the same file cannot silently overwrite each other's idea of history. Use -Force to append anyway, which branches rather than overwrites.
Save-ShpChat -Path ./review-session.json
Appends the current conversation as a new checkpoint.
Save-ShpChat -Path ./review-session.json -Label 'before the refactor'
Appends a named checkpoint you can come back to.
Append even when the store has been advanced by another writer since this session last read it. Nothing is overwritten; the new checkpoint is chained to the one this session knows.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseA short caller-chosen name for this checkpoint, shown by Get-ShpChatCheckpoint.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe store file to write. 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: FalsePrompts 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: FalseShows 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: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
- Clear-ShpChat
- Clear-ShpContext
- Clear-ShpRedactionPolicy
- Clear-ShpToolPolicy
- Clear-ShpUsage
- Compress-ShpChat
- ConvertTo-ShpAnnotation
- ConvertTo-ShpOtelTrace
- ConvertTo-ShpTokenCount
- Get-ShpChat
- Get-ShpChatCheckpoint
- Get-ShpContext
- Get-ShpContextReport
- Get-ShpCosineSimilarity
- Get-ShpCostEstimate
- Get-ShpDefault
- Get-ShpMcpServer
- Get-ShpModel
- Get-ShpModelName
- Get-ShpRedactionPolicy
- Get-ShpTool
- Get-ShpToolPolicy
- Get-ShpUsage
- Initialize-Shp
- Invoke-Shp
- Invoke-ShpBatch
- Invoke-ShpEval
- Invoke-ShpSubagent
- Register-ShpMcpServer
- Register-ShpTool
- Request-ShpEmbedding
- Resolve-ShpError
- Restore-ShpChat
- Save-ShpChat
- Select-ShpModel
- Set-ShpContext
- Set-ShpRedactionPolicy
- Set-ShpToolPolicy
- Start-ShpChat
- Test-ShpCiReadiness
- Unregister-ShpMcpServer
- Unregister-ShpTool