Dev & Engineering ✓ Microsoft · Official

SkillOpt-Sleep: Sleep-Cycle Self-Improvement for Your Local Claude Agent

Give your Claude agent a nightly offline sleep cycle that reviews real sessions and keeps only validation-gated improvements — no model-weight training.

64/ 100
Recommended

Generally reliable with disclosed limitations; trial as directed and keep a rollback path.

See how it was scored ↓
Works as-is in
Claude Code · Codex(Partial support)
Stars
★ 18k
Last updated
19d ago
License
MIT
skill-optimizationmemory-consolidationsession-replayself-evolving-agents
+2validation-gatecron-scheduling

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
Good fit
  • 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
Not a fit
  • 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?

Before you start
Your agent needs
  • Shell / CLI
  • Network access
  • Local filesystem
Install first
  • 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 skillopt

Install 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?

Try saying

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 17

Key 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?

Pros
  • 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
Limitations
  • 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?

FollowSkills review · FSRS-1.0
Recommended
64/ 100 5-point scale 3.2 / 5
1Utility14 / 20 · 3.5/5
2Reliability13 / 20 · 3.3/5
3Safety15 / 25 · 3.0/5

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.

4Evidence7 / 15 · 2.3/5
5Usability7 / 10 · 3.5/5
6Maintenance8 / 10 · 4.0/5
1 2 3 4 5 6

Open a dimension to read why it scored that way

Reviewed Jul 17, 2026 Review evidence[1]

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 →

FAQ

Will it silently change my CLAUDE.md/SKILL.md?
No. Runs write only to a staging directory (proposed_* files plus reports). Live files are replaced only via explicit adopt or your requested --auto-adopt, always with a backup first. The SKILL.md hard-rules section forbids hand-editing live files.
Can I verify the mechanism without paying for API calls?
Yes. The default mock backend makes no provider calls, and a deterministic synthetic demo — python -m skillopt_sleep.experiments.run_experiment --persona researcher --assert-improves — shows score lift and the gate blocking a regression.
How is cost controlled?
Mock costs nothing. Real backends (claude/codex, etc.) bill against your chosen model; --max-sessions/--max-tasks/--edit-budget cap the scale. Note that held-out lift is run-specific evidence, not a universal guarantee.
What if my sessions contain sensitive data?
Don't run a real backend directly. First harvest --output <file> to export the task JSON, inspect/redact it, set "reviewed": true, and replay with --tasks-file; real backends refuse an unreviewed task file.

More skills from this repository

All from microsoft/SkillOpt

Related skills