Session Resume for Openclaw

Session Resume provides automated task state persistence and recovery to ensure long-running AI agent workflows survive session interruptions or restarts.

wavmson
v1.0.0
Apr 2, 2026
0
797
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install session-resume

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install session-resume using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Session Resume?

Session Resume is a specialized skill designed to safeguard progress during long-running AI agent operations. It addresses the common challenge where a Gateway restart, network failure, or session compression causes the agent to lose its place in a complex workflow. By utilizing task state persistence, this skill ensures that Openclaw Skills can pick up exactly where they left off, saving users from the frustration of re-explaining requirements or losing intermediate work.

This skill operates by periodically saving the execution status to a dedicated local JSON file. Upon a new session initiation or a manual recovery trigger, it analyzes the stored data to provide a comprehensive report of completed and pending steps, allowing the user to seamlessly continue the operation with full context.

Session Resume Use Cases

  • Automated detection and recovery at the start of every new session.
  • Manual task restoration when a user requests to resume or restore a previous state.
  • First-dialogue recovery after a Gateway restart or unexpected system crash.
  • Maintaining continuity for multi-step, long-duration tasks that span multiple sessions or hours.

How Session Resume Works

  1. Detection Phase: Upon session startup, the skill checks for the existence of a valid task state file at ~/.openclaw/workspace-main/.task-state.json.
  2. Restoration Phase: If a file is found, the skill extracts the original task description, current progress milestones, pending items, and key execution context.
  3. Reporting Phase: The agent generates a structured recovery report for the user, clearly detailing what was already finished and what remains to be done.
  4. Execution Decision: The system waits for user confirmation to either continue from the last checkpoint or abandon the task and clear the state file.

Session Resume Setup

To enable session recovery, ensure your agent configuration includes a check for the task state file during initialization. Openclaw Skills require the workspace directory to be accessible.

# Ensure the workspace directory exists
mkdir -p ~/.openclaw/workspace-main/

Add the following logic to your agent's startup sequence:

  1. Check for the existence of .task-state.json.
  2. If present, execute the session-resume skill to restore the task environment.

Session Resume Data Schema & Taxonomy

The skill persists state data in a structured JSON format to ensure reliable recovery. Below is the metadata taxonomy used:

Key Type Description
taskId String A unique identifier for the specific task session.
description String The original user request or objective being processed.
status String The current lifecycle state (e.g., in_progress, done).
steps Array A list of sub-tasks with their individual completion status and results.
context Object Critical key-value pairs including file paths and intermediate values.
lastCheckpoint String A timestamped marker of the last successfully completed step.

Session Resume Advanced Features

  • Checkpoint-based Continuation: Resumes execution precisely from the last recorded successful step, avoiding redundant API calls.
  • Smart Compact Integration: Cooperates with session compression tools to save state before memory is cleared.
  • Automatic Cleanup: Deletes state files immediately upon 100% task completion to prevent accidental recovery of old tasks.
  • Multi-Agent Synergy: Works with long-term memory skills to ensure recovered task outcomes are eventually archived into permanent records.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*