Skip to content
Skills Library
AI & agents · Automation

agent-sleep

/agent-sleep

Sleep-cycle memory management for coding agents. Use when consolidating a finished session into memory, running daily memory hygiene or drift checks, prestudying a repo before the next session, reconciling accumulated memory, rebuilding memory from source, or installing the wake/sleep triggers on a new machine or platform. Modes are offline by design — never run consolidation inline during an interactive session.

Repository
agent-sleep ↗
Licence
MIT
Last repository change
03.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
21
Scripts
6
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 03.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 6 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/install-triggers.sh, scripts/prune-ttl.sh, scripts/rollback.sh, scripts/run-fixtures.sh, scripts/snapshot.sh, scripts/verify-memory.sh

What it does and when to use it

Sleep-cycle memory management for coding agents. Use when consolidating a finished session into memory, running daily memory hygiene or drift checks, prestudying a repo before the next session, reconciling accumulated memory, rebuilding memory from source, or installing the wake/sleep triggers on a new machine or platform. Modes are offline by design — never run consolidation inline during an interactive session.

Original author description

Sleep-cycle memory management for coding agents. Use when consolidating a finished session into memory, running daily memory hygiene or drift checks, prestudying a repo before the next session, reconciling accumulated memory, rebuilding memory from source, or installing the wake/sleep triggers on a new machine or platform. Modes are offline by design — never run consolidation inline during an interactive session.

How it works

  1. The invariants
  2. Memory file format
  3. Running the modes
  4. What this is not
Original SKILL.md headings · 81 lines, 535 words
SKILL.md preview
---
name: agent-sleep
description: >-
  Sleep-cycle memory management for coding agents. Use when consolidating a
  finished session into memory, running daily memory hygiene or drift checks,
  prestudying a repo before the next session, reconciling accumulated memory,
  rebuilding memory from source, or installing the wake/sleep triggers on a
  new machine or platform. Modes are offline by design — never run
  consolidation inline during an interactive session.
---

# agent-sleep

A memory architecture for coding agents, built around one split: sessions
work, offline phases remember. The agent that does the task should not be the
agent doing memory bookkeeping in the same breath.

Six modes, each with a trigger:

| Mode | Trigger | What runs |
| --- | --- | --- |
| consolidate | session end (off-peak) | extract → verify vs raw source → promote |
| check | daily, scripts only | TTL expiry, pointer re-validation, founding tests |
| reconcile | N new memories, or a contradiction flag | dedupe, prune, scoped rewrites |
| prestudy | idle (off-peak) | re-derive repo state into warm-start memory |
| rebuild | re-grounding costs more than maintaining | regenerate memory from source |
| rollback | drift alarm, or any bad write | restore last-known-good from git |

## The invariants

These exist because specific, measured failure modes were documented
(see README for the evidence). Breaking one is a bug even if nothing
visibly breaks today.

1. **Never summarize a summary.** Extraction reads the raw transcript and the
   repo. Existing memory is never an input to consolidation.
2. **Never write the charter.** `AGENTS.md` (or platform equivalent) and skill
   cores are re-loaded fresh each session and live outside every write path
   this skill offers. If a mode seems to need charter edits, stop and report.
3. **Admit less.** A candidate memory enters only if it passed verification
   against a source and carries a scope. When in doubt, drop it.
4. **Every write is a git commit.** One writer at a time, one commit per
   promotion, via `scripts/snapshot.sh`. No exceptions, no batch rewrites
   outside reconcile.
5. **Check daily, rewrite on trigger.** Mechanical checks are cheap and
   frequent; semantic rewrites are rare and batched. Each rewrite is a
   compression event — spend them.

## Memory file format

Every memory is one file with frontmatter (see `templates/memory-file.md`):

```yaml
name: short-kebab-slug
description: one line, used for recall decisions
metadata:
  type: user | feedback | project | reference
  scope: when this applies — and when it does not
  source: /path/or/URL/or session:<id>
  verify: optional command that must exit 0
  ttl_days: 30
  last_validated: 2026-10-28
```

An index file (`MEMORY.md`) lists one line per memory and nothing else.
The index routes recall; the files carry the facts.

## Running the modes

Scripts are plain bash; the only dependencies are git, curl, and a POSIX
shell. Model-driven steps use the prompt templates in `templates/prompts/`
with the strongest model available — consolidation quality is the whole game.

    scripts/snapshot.sh <memory-dir> [message]     # commit memory state
    scripts/rollback.sh <memory-dir> [N]           # restore N commits back
    scripts/verify-memory.sh <memory-dir>          # re-validate every entry
    scripts/prune-ttl.sh <memory-dir> [--apply]    # list/move expired entries
    scripts/run-fixtures.sh <fixtures-dir>         # founding tests, exit 1 on drift
    scripts/install-triggers.sh                    # platform wiring

Platform-specific trigger wiring (hooks, idle queues, cron) lives in
`adapters/` — one file per platform, starting with ZCode, Claude Code,
OpenCode, and a generic cron adapter that covers the rest.

## What this is not

It is not parametric learning. Everything lives in token space — files a
harness reads. That ceiling is real (weight-space consolidation outperforms
it in the literature), and the payoff is that memory survives every model
swap underneath.
Files in this package (21)
  • .gitignore 1 KB
  • LICENSE 1 KB
  • README.md 5 KB
  • SKILL.md 4 KB
  • adapters/claude-code.md 2 KB
  • adapters/generic.md 2 KB
  • adapters/opencode.md 1 KB
  • adapters/zcode.md 2 KB
  • scripts/install-triggers.sh 2 KB
  • scripts/prune-ttl.sh 2 KB
  • scripts/rollback.sh 1 KB
  • scripts/run-fixtures.sh 1 KB
  • scripts/snapshot.sh 1 KB
  • scripts/verify-memory.sh 3 KB
  • templates/charter.md 1 KB
  • templates/fixture.md 1 KB
  • templates/memory-file.md 1 KB
  • templates/prompts/check.md 1 KB
  • templates/prompts/consolidate.md 2 KB
  • templates/prompts/prestudy.md 2 KB
  • templates/prompts/reconcile.md 2 KB

Versions

The database has no other skills named agent-sleep.

Database snapshot: 13.11.2026 · package version fc29d590f5e3 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95sleep
    Run the memory sleep cycle - capture wake observations, consolidate them into provisional candidates, review them, and promote only what replay has measured. Use when the user asks to save what was learned, run a memory/sleep pass, review provisional memory, or asks why memory…
  • 100sleep
    Use Sleep's reviewable T0 to T1 to T2 memory cycle in Pi or OmO. Use when the user asks to capture a durable observation, run sleep or dream, inspect provisional memory, measure replay, or promote an approved candidate.
  • 100skillopt-sleep
    Use when the user wants their Claude agent to self-improve from past usage, asks about a nightly/offline 'sleep' or 'dream' cycle, memory/skill consolidation, or says things like 'make my agent better the more I use it', 'review my past sessions', 'learn my preferences',…
  • 100skillopt-sleep
    Use when the user wants their Claude agent to self-improve from past usage, asks about a nightly/offline 'sleep' or 'dream' cycle, memory/skill consolidation, or says things like 'make my agent better the more I use it', 'review my past sessions', 'learn my preferences',…
  • 96sleep
    Run LR Memory's sleep pass now. It reads what the user said in each project since the last pass, writes their standing rules, corrections and the facts they stated as memory files that every later session loads, and lets lessons drawn from what happened wait until a later pass…
  • 100skillopt-sleep
    Use when the user wants their Claude agent to self-improve from past usage, asks about a nightly/offline 'sleep' or 'dream' cycle, memory/skill consolidation, or says things like 'make my agent better the more I use it', 'review my past sessions', 'learn my preferences',…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.