Skillopt Sleep
Use when the user wants the dsh agent to self-improve from past usage, asks about a...
Install
npx skills add microsoft/SkillOpt --skill skillopt-sleep -g -a claude-code -y- Repository
- microsoft/SkillOpt18.8k
- Category
- AI and agents
- Updated
- 3d ago
- License
- MIT
- Context cost
- Lightabout 1,282 tokens
- Runs scripts
- No, instructions only
What it does
Use when the user wants the dsh agent to self-improve from past usage, asks about a nightly/offline 'sleep' or 'dream' cycle, skill/memory consolidation, or says things like 'make my agent better the more I use it', 'review my past sessions', 'learn my preferences', 'consolidate what you learned', 'run the sleep cycle', or wants to schedule background self-optimization. Drives the skillopt_sleep engine through the skillopt_* tools: harvest past sessions -> mine recurring tasks -> replay via a selected backend -> consolidate validated skills behind a held-out gate.
SkillOpt-Sleep: usage-driven self-evolution for the dsh agent
SkillOpt-Sleep is Microsoft's SkillOpt deployment-time companion engine: it reviews your past sessions (harvest), mines recurring tasks (mine), replays them through a selected backend (replay), and consolidates what it learns into skill documents behind a held-out validation gate (consolidate).
This skill drives the engine through the 7 skillopt_* tools exposed by the
dsh-skillopt plugin. The default mock backend makes no model calls, which is
useful for verifying the plumbing; a real backend consumes your API budget.
When to use
- "make my agent better the more I use it" / "learn my preferences across sessions"
- a one-off offline self-evolution / sleep / dream run (immediate or scheduled)
- review past sessions/trajectories and distill recurring tasks
- consolidate feedback into
AGENTS.md/SKILL.md/ managed skills - schedule (cron) the cycle, or adopt a staged proposal
The cycle (six stages)
- Harvest, read-only scan of supported local session records → digests
- Mine, digests → recurring task records (intent + outcome labels + checkable refs)
- Replay, re-run tasks under the current skill+memory with the selected backend → (hard, soft) scores
- Consolidate, reflect on failures → propose bounded edits → validation gate on a held-out slice (default: accept only on strict improvement)
- Stage, write accepted proposals to
<project>/.skillopt-sleep/staging/<timestamp>/. Live files are unchanged. A rejected run still has a report but no proposal files. - Adopt, explicit (or operator-configured
--auto-adopt) copies staged files over live ones, backing up first.
Driving it
Prefer the tools over hand-editing files:

