← Back to Skills Marketplace
belugary

Boot Resume

by Belugary · GitHub ↗ · v1.1.1 · MIT-0
cross-platform ✓ Security Clean
174
Downloads
1
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install boot-resume
Description
Zero-cooperation session recovery after gateway restart. No checkpoints, no hooks, no agent involvement — just reads the evidence and picks up where it left...
README (SKILL.md)

Boot Resume

Zero-cooperation session recovery after gateway restart. No checkpoints, no hooks, no agent involvement — just reads the evidence and picks up where it left off.

Problem

When the gateway restarts, any in-flight agent turn dies mid-execution. Session history is preserved on disk, but the agent doesn't know it needs to continue. Users must manually tell each interrupted session to resume.

Checkpoint-based approaches require the agent to save state before dying. Unexpected kills (SIGKILL, OOM, power loss) bypass this entirely.

Solution

A deterministic shell script runs on every gateway start via systemd ExecStartPost. No LLM in the detection loop.

┌─────────┐     ┌──────────┐     ┌──────────┐
│  Scan   │ ──▶ │  Detect  │ ──▶ │  Resume  │
│sessions │     │  JSONL   │     │ cron add │
│ .json   │     │  tail    │     │--sys-evt │
└─────────┘     └──────────┘     └──────────┘
  1. Scan — finds sessions updated within the last 20 minutes
  2. Detect — reads the last 5 JSONL lines to classify session state
  3. Resume — schedules a one-shot openclaw cron add --system-event --wake now to inject a continuation prompt

Key insight: the JSONL session files already contain all the evidence needed to detect an interruption — no pre-save required.

Detection Rules

Last JSONL Entry Status Meaning
toolResult INTERRUPTED Tool returned, agent never processed it
assistant (empty text) INTERRUPTED Tool call dispatched, killed before response
user (non-trivial) INTERRUPTED Message received, never processed
assistant (with text) COMPLETE Session ended normally — skip
user (trivial: "ok", emoji) TRIVIAL No meaningful request pending — skip

Install

One command

bash {baseDir}/install.sh

Deploys three components:

  • boot-resume-check.sh~/.openclaw/workspace/scripts/
  • boot-resume.conf → systemd drop-in (triggers script on every gateway start)
  • boot-resume-wake.service → systemd user service (triggers script on system wake from sleep/suspend)

Manual

cp {baseDir}/scripts/boot-resume-check.sh ~/.openclaw/workspace/scripts/
chmod +x ~/.openclaw/workspace/scripts/boot-resume-check.sh

mkdir -p ~/.config/systemd/user/openclaw-gateway.service.d
cp {baseDir}/templates/boot-resume.conf ~/.config/systemd/user/openclaw-gateway.service.d/
cp {baseDir}/templates/boot-resume-wake.service ~/.config/systemd/user/

systemctl --user daemon-reload
systemctl --user enable boot-resume-wake.service

Verify

systemctl --user restart openclaw-gateway
sleep 20
cat /tmp/openclaw/boot-resume.log

Expected output:

[boot-resume] now=... cut=... (20min window)
[boot-resume] scanning agent: main
[boot-resume] candidates: 0 (agent=main)
[boot-resume] done

Test

  1. Send a message that triggers a multi-step task (web search, code analysis, etc.)
  2. Wait for the agent to start processing (tool calls in flight)
  3. systemctl --user restart openclaw-gateway
  4. Agent resumes automatically within ~35 seconds

Slash Command

When invoked as /boot-resume, run the script with --no-wait to skip the startup delay:

bash {baseDir}/scripts/boot-resume-check.sh --no-wait

Report results to the user: which sessions were resumed, or that none were found.

Configuration

Variable Default Description
WINDOW_MINUTES 20 How far back to scan for interrupted sessions
DELAY 20s Delay before injecting the resume event

Edit at the top of scripts/boot-resume-check.sh.

Features

  • Dual trigger — covers both gateway restart (ExecStartPost) and system sleep/wake (systemd sleep.target)
  • Multi-agent support — scans all agents under ~/.openclaw/agents/, not just main
  • Smart filtering — skips system, heartbeat, cron, and subagent sessions automatically
  • Deduplication — respects restart-resume.json to avoid double-resuming planned restarts
  • Log rotation — auto-truncates log at 1000 lines
  • Error visibility — Python and cron errors are logged, not swallowed
  • Unique job names — timestamp-based to prevent conflicts on rapid restarts

Comparison

Approach Pre-save required Survives SIGKILL LLM-free
Checkpoint / snapshot files Yes No No
Pre-restart state dump Yes No No
Session history replay Yes Partial No
Post-hoc JSONL detection (this skill) No Yes Yes

Logs

Output: /tmp/openclaw/boot-resume.log

Each run logs: timestamp, scan window, candidate count, per-session status, and whether a resume job was armed.

Limitations

  • 20-minute scan window (configurable) — sessions idle longer than this are not resumed
  • Resume prompt is generic — the agent relies on session context for continuity
  • Telegram/Discord message queues already handle unprocessed incoming messages — this skill targets mid-execution interruptions
  • Requires systemd (Linux); macOS users need manual launchd setup

Uninstall

rm ~/.config/systemd/user/openclaw-gateway.service.d/boot-resume.conf
systemctl --user disable boot-resume-wake.service 2>/dev/null
rm ~/.config/systemd/user/boot-resume-wake.service
systemctl --user daemon-reload
rm ~/.openclaw/workspace/scripts/boot-resume-check.sh
rm -rf ~/.openclaw/workspace/skills/boot-resume
Usage Guidance
This skill is internally consistent with its description: it reads OpenClaw session JSONL files and schedules local resume jobs via openclaw cron. Before installing, review and understand that it will (1) copy and execute a script under ~/.openclaw/workspace/scripts/, (2) add user systemd drop-ins so the script runs at gateway start and on wake, and (3) read full conversation/session files (which can contain sensitive data) and cause the agent to autonomously resume those sessions. If you do not fully trust the skill source, inspect the two provided scripts (install.sh and scripts/boot-resume-check.sh) line-by-line and consider running the installer interactively (so you can refuse overwrites). Test in a non-production environment first, and ensure you are comfortable with automatic resumption of interrupted conversations before enabling the wake/ExecStartPost integration.
Capability Analysis
Type: OpenClaw Skill Name: boot-resume Version: 1.1.1 The boot-resume skill is a utility designed to automatically recover interrupted agent sessions after a gateway restart or system wake. It functions by scanning local session JSONL files for specific interruption patterns (e.g., pending tool results) and scheduling a continuation event via the 'openclaw cron' command. The implementation in 'boot-resume-check.sh' and 'install.sh' is transparent, well-documented, and lacks any indicators of data exfiltration, malicious execution, or unauthorized persistence beyond its stated purpose of systemd integration.
Capability Assessment
Purpose & Capability
The skill declares python3 and openclaw (used to parse JSONL and schedule resume jobs). The installer copies a script into ~/.openclaw/workspace/scripts/ and adds systemd user drop-ins — all consistent with 'run on gateway start/wake' behavior. Required binaries and files align with the resume/recovery purpose.
Instruction Scope
The runtime script reads OpenClaw session index and per-session JSONL files, classifies last entries, and uses openclaw cron add to inject a resume system-event. This matches the described detection/resume flow. Note: the script accesses full conversation contents in session files (sensitive data) and will cause the agent to resume those sessions automatically. That privacy/automation impact is expected for the stated feature but worth the user's attention.
Install Mechanism
No remote downloads or package installs. install.sh copies local files into the user's ~/.openclaw workspace and user systemd config, then reloads/enables user services. This is a local, low-risk install mechanism (no arbitrary network fetches or extracted archives).
Credentials
No secrets or unrelated environment variables are requested. The script optionally reads OPENCLAW_STATE_DIR and only touches files under the OpenClaw state directory and /tmp/openclaw logs. Access to session files is necessary for its function but grants read access to possibly sensitive conversation history — this is proportional to purpose but a privacy consideration.
Persistence & Privilege
The installer creates a user-level systemd drop-in and a wake service so the script runs automatically on gateway start and system wake. always:false (not force-included), but the skill gains persistent, automatic execution on those events. This is expected for the functionality but increases impact if the installed script were malicious.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install boot-resume
  3. After installation, invoke the skill by name or use /boot-resume
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.1.1
Add files manifest to SKILL.md metadata for security scan verification
v1.1.0
Fix multi-agent targeting; add sleep/wake support
v1.0.0
Initial release: zero-cooperation session recovery via post-hoc JSONL detection. Multi-agent support, log rotation, smart filtering, bilingual docs.
Metadata
Slug boot-resume
Version 1.1.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is Boot Resume?

Zero-cooperation session recovery after gateway restart. No checkpoints, no hooks, no agent involvement — just reads the evidence and picks up where it left... It is an AI Agent Skill for Claude Code / OpenClaw, with 174 downloads so far.

How do I install Boot Resume?

Run "/install boot-resume" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Boot Resume free?

Yes, Boot Resume is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Boot Resume support?

Boot Resume is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Boot Resume?

It is built and maintained by Belugary (@belugary); the current version is v1.1.1.

💬 Comments