Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Deepsleep

ASecurity

Two-phase daily memory persistence for AI agents. Nightly pack at 23:40 plus morning dispatch at 00:10. Auto-discovers sessions, filters by importance, tracks open questions, and delivers per-group morning briefs.

2 stars
0 votes
0 copies
0 views
Added 9/29/2026
devopsbash

Security Analysis

A100/100

Scanned 9/29/2026

$npx -y skills add Arry8/openclaw-edge --skill deepsleep --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Deepsleep?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Deepsleep
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/arry8-deepsleep/badge)](https://www.skillsdirectory.com/skills/arry8-deepsleep)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: deepsleep
description: Two-phase daily memory persistence for AI agents. Nightly pack at 23:40 plus morning dispatch at 00:10. Auto-discovers sessions, filters by importance, tracks open questions, and delivers per-group morning briefs.
---

# DeepSleep

Two-phase daily memory persistence for AI agents.

Like humans need sleep for memory consolidation, AI agents need DeepSleep to persist context across sessions.

## When to Activate

Activate when user mentions daily summary, memory persistence, sleep cycle, cross-session memory, morning brief, or nightly pack.

## Phases

### Phase 1: Deep Sleep Pack (23:40)

1. **Auto-discover sessions** — Use `sessions_list(kinds=['group', 'main'], activeMinutes=1440)` to find all active groups AND direct messages from the past 24 hours. New groups are automatically included.
2. **Pull conversation history** — For each active session, use `sessions_history(sessionKey=<key>, limit=100)`.
3. **Filter and summarize** — Apply filtering criteria to generate concise summaries:
   - Keep: Decisions, Lessons, Preferences, Relationships, Milestones
   - Skip: Transient (heartbeats, weather), Already captured in MEMORY.md
4. **Schedule future items** — Extract future-dated reminders and write to `memory/schedule.md` with trigger dates.
5. **Write daily file (idempotent)** — Write the `## Daily Summary (DeepSleep)` section to `memory/YYYY-MM-DD.md`. Before writing, check if a `## Daily Summary (DeepSleep)` header already exists for today — if so, replace it instead of appending a duplicate. This ensures retries and re-runs produce the same result.
6. **Update long-term memory (privacy-safe)** — Merge-update `MEMORY.md` (update in place, don't append duplicates; remove outdated info). **Important:** Do NOT copy private MEMORY.md content into the daily summary file. The daily file may be broadcast to groups in Phase 2 — only include information that originated from those groups' own conversations.

### Phase 2: Morning Dispatch (00:10)

1. **Read yesterday's summary** — Load `memory/YYYY-MM-DD.md` from the previous day.
2. **Send per-group briefs** — For each group with content, send a personalized morning recap via `message(action='send', target='chat:<id>')`. Only include information from that specific group's summary — never cross-leak content between groups or from MEMORY.md.
3. **Include reminders** — Attach any schedule items due today.
4. **Track open questions** — Include relevant Open Questions for continuity.

## Daily Summary Template

```markdown
## Daily Summary (DeepSleep)

### [Group Name]
- Concise summary of key discussions and decisions

### Direct Messages
- (DM content if any)

### Open Questions
- Unresolved questions, tracked across days

### Tomorrow
- Actionable next steps

### Todo
- [ ] Immediate action items
```

## Schedule File Format

File: `memory/schedule.md`

```markdown
| Date | Source | Item | Status |
|------|--------|------|--------|
| YYYY-MM-DD | Group/DM | Description | pending/done |
```

## Setup

### 1. Create cron jobs

```bash
# Phase 1: Pack (adjust timeout for your session count; ~30s per active session)
openclaw cron add \
  --name "deepsleep-pack" \
  --cron "40 23 * * *" \
  --tz "Your/Timezone" \
  --system-event "Execute DeepSleep Phase 1. Read the deepsleep skill and follow the pack process." \
  --timeout-seconds 300

# Phase 2: Dispatch
openclaw cron add \
  --name "deepsleep-dispatch" \
  --cron "10 0 * * *" \
  --tz "Your/Timezone" \
  --system-event "Execute DeepSleep Phase 2. Read the deepsleep skill and follow the dispatch process." \
  --timeout-seconds 120
```

**Timeout guidance:** Phase 1 needs ~30 seconds per active session for history pull + summarization. Default 300s covers ~10 sessions comfortably. For larger deployments, increase to 600s or more.

### 2. Enable cross-session visibility

```bash
openclaw config set tools.sessions.visibility all
openclaw gateway restart
```

### 3. Initialize schedule

Create `memory/schedule.md` with the table header above.

## Requirements

- OpenClaw with `tools.sessions.visibility` set to `all`
- Cron jobs using `systemEvent` mode (main session access)

## Phase 3: Session Memory Restore (on demand)

The most critical piece — when the agent receives a message in a group session:

1. Check if `memory/groups/<chat_id>.md` exists
2. If yes, read it to restore context about recent discussions, open questions, and todos
3. This is configured in `AGENTS.md` under "群 Session 记忆恢复"

Without this step, Phases 1-2 only help the human (morning brief), but the agent itself still wakes up with no memory.

### File structure
```
memory/groups/
├── oc_abc123.md    # Group A: recent 3-day summary + open questions
├── oc_def456.md    # Group B: recent 3-day summary + open questions
└── ...
```

Phase 2 generates/updates these files each morning. They are compact (< 2KB each) and designed for fast loading.

## Privacy Notes

- Phase 1 writes a daily summary that Phase 2 broadcasts to groups. Never include private MEMORY.md content in the daily summary.
- Each group only receives its own summary in the morning dispatch — no cross-group content leakage.
- MEMORY.md is updated separately and stays in the main session context only.
- Per-group memory snapshots only contain that group's own conversation summaries.

## Inspirations

Built with insights from the community: agent-sleep (multi-level sleep), memory-reflect (filtering criteria), jarvis-memory-architecture (cron inbox), memory-curator (open questions).

Attribution

Arry8Arry8
View sourceSee grades on GitHubMore from Arry8 →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Terraform Module Library

Build reusable Terraform modules for AWS, Azure, and GCP infrastructure following infrastructure-as-code best practices. Use when creating infrastructure modules, standardizing cloud provisioning, or implementing reusable IaC components.

401991 votes

sematext-otel

Wire a service's OpenTelemetry output to Sematext Cloud. Walks through region, App-type, instrumentation flow (managed OTLP endpoint vs Sematext Agent), and signal selection (traces/metrics/logs), then produces the exact env-var block and points at a runnable reference example in this repo. Invoke when instrumenting a new app for Sematext.

01 votes

Deployment Patterns

Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications. Use when setting up deployment infrastructure or planning releases.

2699140 votes

Babysit

Watch a pull request or review cycle until it is ready to merge. Use when asked to babysit, monitor, or keep checking PR comments, reviews, and CI until all actionable issues are resolved.

971540 votes

V7 Roster

Interact with the Paperclip control plane API for task coordination and governance. Use when checking assignments, updating issue status, posting comments, delegating work, managing routines, or calling Paperclip API endpoints.

953190 votes
View all in devops →