What does this skill do, and when should you use it?
SkillOpt-Sleep is one of the five skills bundled in microsoft/SkillOpt, giving a local Claude Code agent a “sleep cycle” for self-evolution. On demand or on a nightly cron schedule, it reads past real Claude Code sessions, mines recurring tasks, replays them through a selected backend under the current skill+memory, and consolidates only edits that strictly improve a held-out validation score into CLAUDE.md and SKILL.md. Live files change only through explicit adoption or user-requested --auto-adopt, with backups first. The default mock backend runs the full plumbing with zero API spend; real backends require attention to the documented data-boundary rules.
- Reads ~/.claude/projects/*/<session>.l and ~/.claude/history.l (read-only) into session digests
- Mines digests into TaskRecords (recurring intents, outcome labels, checkable refs)
- Replays tasks through a chosen backend (mock/claude/codex/copilot/handoff/azure_openai) and scores them
- Reflects on failures, proposes bounded add/delete/replace edits, accepts only if the held-out score strictly improves
- Stages proposed_CLAUDE.md / proposed_SKILL.md plus report.md, report., manifest., diagnostics. — nothing live changes
- Applies staged proposals via explicit adopt (with backup) or user-requested --auto-adopt
- A Claude Code user who wants their agent to “get better the more I use it” and remember preferences across sessions
- A developer who wants a nightly cron that reviews the day's sessions and distills experience into skill files
- Anyone testing the plumbing for free first: mock-backend dry-run previews with no API spend
- Privacy-conscious users of real backends: harvest --output to export task JSON, inspect/redact, then replay with --tasks-file
- Teams injecting house rules via --preferences (e.g. “Always use async/await”) into the optimizer's reflection prior
- Users expecting live, in-loop improvement or model-weight training — this skill never touches weights; it stages proposals behind a gate for you to adopt
- Users with highly sensitive sessions who won't review exported task files — real backends send truncated transcript content to the provider
How do you install this skill?
- Shell / CLI
- Network access
- Local filesystem
Python 3.10+skillopt-sleep CLI (skillopt v0.2.0+)cron for scheduling
The skill ships in the microsoft/SkillOpt repository (MIT license) at plugins/claude-code/skills/skillopt-sleep/, requiring Python 3.10+. Install the engine:
pip install skilloptInstall the plugins/claude-code/ plugin into Claude Code; the skill entry point is plugins/claude-code/skills/skillopt-sleep/SKILL.md. The v0.2.0 release source adds integration shells for Claude Code, Codex, Copilot, and Devin plus an OpenClaw reference adaptation, but plugin/MCP files live in the repository, not the PyPI wheel.
How do you use this skill?
Once installed, send your agent any of these to trigger it:
- Run the sleep cycle and show me which tasks I repeated this week, then stage a proposal
- Schedule a nightly self-optimization run at 3 a.m.
- Review my past sessions, learn my preferences, and consolidate them into CLAUDE.md
- Without spending API budget, do a mock dry-run and show me what you'd propose
Drive the six-stage cycle (harvest → mine → replay → consolidate → stage → adopt) via the /skillopt-sleep command or the bundled runner:
"${CLAUDE_PLUGIN_ROOT}/scripts/sleep.sh" dry-run --project "$(pwd)"
"${CLAUDE_PLUGIN_ROOT}/scripts/sleep.sh" run --project "$(pwd)"
"${CLAUDE_PLUGIN_ROOT}/scripts/sleep.sh" adopt --project "$(pwd)"
"${CLAUDE_PLUGIN_ROOT}/scripts/sleep.sh" schedule --project "$(pwd)" --hour 3 --minute 17Key flags: --backend mock|claude|codex|copilot|handoff|azure_openai (default mock, no provider calls), --scope all|invoked, --lookback-hours 72, --max-tasks 40, --edit-budget 4, --auto-adopt, --. Advanced behavior (gate_mode, gate_metric, evolve_memory/evolve_skill, dream_rollouts, recall_k) lives in ~/.skillopt-sleep/config..
What are this skill's strengths and limitations?
- Default validation gate: only edits that strictly improve a held-out score are accepted; rejected edits are recorded in the run report
- Mock backend proves out the entire pipeline at zero API cost; a deterministic synthetic demo (run_experiment --assert-improves) shows score lift and gate rejection
- Stage-then-adopt workflow guarantees live files are never silently modified, and adoption always backs up first
- Consolidates both skills (SKILL.md) and project memory (CLAUDE.md), independently toggleable
- A held-out gain is run-specific evidence, not a guarantee of broader improvement; results depend on tasks, model, and checks
- Real backends send truncated transcript excerpts to providers with no guarantee every secret is stripped — sensitive sessions require the export-review-replay path
- Scheduling depends on cron, and published evidence centers on the paper's benchmarks and Claude Code; other hosts are not equally validated
- Nightly defaults are conservative (40 tasks, 4 edits), so deeper optimization means tuning caps and paying real API costs
How does this skill compare with similar options?
Side by side with related skills; every score comes from the same FSRS standard.
| Skill | FS score | Stars | Last updated | License |
|---|---|---|---|---|
| SkillOpt-Sleep: Sleep-Cycle Self-Improvement for Your Local Claude Agent this page ✓ Microsoft · Official | 64 · Recommended | ★ 18k | 19d ago | MIT |
| SkillOpt-Sleep ✓ Microsoft · Official | 64 · Recommended | ★ 18k | 19d ago | MIT |
| SkillOpt-Sleep OpenClaw Reference Adaptation ✓ Microsoft · Official | 44 · Not recommended | ★ 18k | 19d ago | MIT |
| Vibe Replay | 56 · Use with care | ★ 38 | 11d ago | MIT |
| Agents Observe | 54 · Use with care | ★ 696 | 1mo ago | MIT |
The README frames it as the deployment-time analogue of training: unlike weight fine-tuning it touches no model parameters and adds zero inference-time model calls; unlike loosely controlled self-revision it uses bounded edits, a held-out gate, and reproducible reports. In the ecosystem, gbrain, gbrain-evals, and darwin-skill have integrated SkillOpt.
How did FollowSkills review this skill?
Officially published by Microsoft (verifiable official source). The core mechanism has an agent offline-review past sessions and self-modify its own CLAUDE.md/SKILL.md — a self-modifying behavior. It has a validation gate (keeps only changes that improve a held-out score) and requires explicit adoption (changes don't silently take effect) — restrained design, but 'an agent rewriting its own instruction files' still warrants understanding the scope of impact.
Open a dimension to read why it scored that way
Evidence confidence:Low — Mostly static review, author material or a limited demo; useful for discovery, not high-risk decisions.
This review was completed under FSRS 1.0. Dimension scores are not converted; it is queued for re-review under FSRS 2.0.
See the full review method →