Openclaw Sleep
Skill by axelhu
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/axelhu/openclaw-sleepWhat This Skill Does
The OpenClaw Sleep skill is a sophisticated session management tool designed to bridge the gap between distinct AI execution cycles. In environments where long-running tasks or complex development processes are split across multiple sessions, the Sleep skill ensures zero data loss and seamless context restoration. By recording pending tasks, technical configurations, and progress summaries into a structured Markdown preview file, the agent can effectively 'hibernate.' Upon awakening, the integrated hook automatically detects the persisted file, parses the technical metadata, and injects the context back into the new session. This allows your agent to maintain continuity across system resets or idle periods.
Installation
To install, run the following command in your terminal:
clawhub install openclaw-sleep
Ensure that you adhere to the deployment rule: the Hook component only needs to be installed once for your main agent. Individual sub-agents only require the skill itself. Post-installation, verify your file path configuration to ensure the ~/.openclaw/workspace/previews/ directory is writable for the session manager.
Use Cases
- Long-term Coding Projects: When an agent is working on a complex codebase and needs to clear memory or reset a session due to context limitations, Sleep preserves file paths, variable states, and TODO lists.
- Interrupt-driven Workflows: When a user needs to force the agent to stop and switch tasks, the sleep command safely packages the current working state.
- Automated Resource Management: Agents can be configured to trigger sleep mode when they determine they have reached a logical checkpoint, optimizing system memory by resetting the session.
Example Prompts
- "I need to step away for a while, please trigger the sleep process and save my current progress on the backend refactoring task."
- "/sleep"
- "We are hitting a memory limit, execute the sleep sequence now, capture all current technical details, and prepare for a fresh session."
Tips & Limitations
- Precision is Key: When the agent drafts the summary, provide explicit details like specific file paths and API endpoints. The more granular the input, the better the recovery.
- Session Integrity: Always identify your unique session key using
openclaw session current. Never overwrite or reference another agent's session file, as this will lead to context contamination. - Reset Mechanism: Remember that the hook only fires during a bootstrap event. The skill does not sleep until the Gateway API successfully performs a session reset.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-axelhu-openclaw-sleep": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read, external-api
Related Skills
contacts
通讯录查询与维护技能。用于查找联系人信息(open_id、chat_id、account_id 等)、记录新联系人、或查询历史沟通偏好。触发时机:(1) 需要 @某人或向某渠道发消息时 (2) 认识新联系人后需要录入通讯录时 (3) 查询某人的联系方式或交流偏好时 (4) 询问"谁知道xxx的飞书ID"或"怎么联系xxx"时。
superpowers-subagent-dev
Use when executing implementation plans with independent tasks - coordinates task execution by dispatching subagents per task with verification checkpoints, adapted for OpenClaw's isolated session model
superpowers-overview
Use when starting any development work or when unsure which superpowers development skill to use - provides entry point and navigation to the full superpowers skill suite for OpenClaw agents
superpowers-executing-plans
Use when executing a written implementation plan in the current session with sequential task execution and review checkpoints - for when subagent-driven mode is not available
superpowers-requesting-code-review
Use when completing tasks, implementing major features, or before merging - dispatches code review subagent to catch issues before they cascade, adapted for OpenClaw sessions_spawn model