Skip to content

[Feature Request]: Session snapshots — save and load context checkpoints (/session save|load) #13700

@gbacskai

Description

@gbacskai

Problem

During long development sessions, users sometimes want to:

  • Test alternative approaches without losing current progress
  • Roll back to a known-good state after mistakes
  • A/B test different prompts or models in parallel
  • Branch conversations without manual transcripts

Currently, OpenClaw saves sessions automatically, but there's no way to:

  1. Create an explicit checkpoint at a specific moment
  2. Reload that exact state (messages + context window + model choice)
  3. Fork a session into parallel branches

Proposed Solution

Add /session save <name> and /session load <name> commands:

# Save current session (all messages, context, model state) to checkpoint
/session save healthcheck-baseline

# Later, reset current session and restore from checkpoint
/session load healthcheck-baseline
# Result: Current session cleared, full context restored to that exact moment

Use Cases

  1. A/B Testing: Save baseline config, test variant A, load baseline, test variant B
  2. Rollback: Save before risky commands, revert if things break
  3. Branching: Fork a conversation to explore multiple paths
  4. Reproducibility: Save working states for debugging or sharing

Implementation Sketch

// Save checkpoint
POST /sessions/{sessionKey}/checkpoints/{name}
- Captures: transcript, context tokens, model, compaction state
- Stores: workspace/session-checkpoints/{sessionKey}-{name}.jsonl

// Load checkpoint  
POST /sessions/{sessionKey}/restore/{name}
- Clears: current transcript
- Restores: checkpoint transcript, context, model
- Effect: Like /reset + history injection, but deterministic

Related Issues

Environment

  • OpenClaw 2026.2.9
  • User: Developer workstation (local + Telegram relay)
  • Use case: Long-running development sessions with context preservation

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.enhancementNew feature or requestimpact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions