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. Use when: the gateway was killed mid-task (SIGTERM, OOM, SIGKILL, crash), sessions were interrupted mid-turn with tool calls in progress, the agent stopped responding after a restart, a user reports the agent went silent after a crash, you need to manually check whether any sessions need recovery, or you want automatic resume without writing any checkpoint logic.
Best use case
boot-resume is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
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. Use when: the gateway was killed mid-task (SIGTERM, OOM, SIGKILL, crash), sessions were interrupted mid-turn with tool calls in progress, the agent stopped responding after a restart, a user reports the agent went silent after a crash, you need to manually check whether any sessions need recovery, or you want automatic resume without writing any checkpoint logic.
Teams using boot-resume should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/boot-resume/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How boot-resume Compares
| Feature / Agent | boot-resume | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
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. Use when: the gateway was killed mid-task (SIGTERM, OOM, SIGKILL, crash), sessions were interrupted mid-turn with tool calls in progress, the agent stopped responding after a restart, a user reports the agent went silent after a crash, you need to manually check whether any sessions need recovery, or you want automatic resume without writing any checkpoint logic.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
Top AI Agents for Productivity
See the top AI agent skills for productivity, workflow automation, operational systems, documentation, and everyday task execution.
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
SKILL.md Source
# 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
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
```bash
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
```bash
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
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
```bash
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
```Related Skills
resume-rewrite
简历改写 skill。用于优化个人总结、工作经历、项目经历、技能和教育经历,强调结果、业务价值和岗位匹配度。当用户说“优化简历”“改写工作经历”“润色项目经历”时使用。
resume-analysis
简历分析 skill。用于诊断整份简历的完整性、清晰度、岗位相关性、成果表达和结构质量。当用户说“分析简历”“看看我的简历”“简历诊断”时使用。
resume-jd-match
AI-powered JD-matched resume generator with native Chinese and English support. Collects structured user profile (work history, projects, skills, education), parses target job descriptions, performs explicit match analysis before generating, then outputs print-optimized HTML resume + auto-export PDF. Core strengths: (1) JD→resume full pipeline with transparency, (2) Chinese resume native support, (3) persistent profile reuse across multiple JDs. Use when: tailoring resume for a job posting, creating resume from scratch, optimizing for ATS, building Chinese/English resume, "make me a resume", "customize resume for this job", "简历定制", "针对岗位优化简历".
resume-tailor
Generate job-specific tailored resumes from a base profile and job description. First collects structured user info (personal details, work history, side projects, education, skills, certificates), then reads a target JD to produce a polished HTML resume customized to match. Outputs print-optimized HTML that exports cleanly to PDF via browser print. Use when user wants to create/rewrite/tailor a resume for a specific job posting, optimize a resume for ATS, build a resume from scratch, or says "make me a resume" / "tailor my resume" / "customize resume for this job". Supports Chinese and English resumes.
resume-helper
简历优化助手。帮我写简历,改简历、导出PDF、准备面试问答。适用于:更新简历、补充项目经验、排版调整、导出PDF、准备面试问答。
resume-parser
智能简历解析系统,支持PDF/Word/图片格式简历的结构化信息提取、岗位匹配度分析、优化建议生成。完全本地运行,无需外部API。使用场景:(1) 解析上传的简历文件提取核心信息,(2) 输入岗位JD计算简历匹配度,(3) 生成简历优化建议,(4) 导出结构化简历数据。
resume-reviewer
Analyze resumes for target roles, identify weak bullets, missing keywords, ATS gaps, and provide actionable rewrite suggestions.
resume-builder
Generate professional resumes that conform to the Reactive Resume schema. Use when the user wants to create, build, or generate a resume through conversational AI, or asks about resume structure, sections, or content. This skill guides the agent to ask clarifying questions, avoid hallucination, and produce valid JSON output for https://rxresu.me.
resume
Resume a paused experiment. Checkout the experiment branch, read results history, continue iterating.
placed-resume-optimizer
This skill should be used when the user wants to "optimize resume for job", "check ATS score", "improve resume bullets", "analyze resume gaps", "tailor resume to job description", "get ATS compatibility score", "improve bullet points", "match resume to job posting", "fix resume for ATS", or wants to maximize their resume's impact and ATS compatibility using the Placed platform at placed.exidian.tech.
placed-resume-builder
This skill should be used when the user wants to "build a resume", "create a resume", "update my resume", "export resume as PDF", "change resume template", "list my resumes", "download resume", "switch template", or wants to manage resumes using the Placed career platform at placed.exidian.tech.
medical-cv-resume-builder
Use medical cv resume builder for academic writing workflows that need structured execution, explicit assumptions, and clear output boundaries.