Skills

Nightly Skill Optimizer

Runs an offline cycle that consolidates past sessions into better agent memory and skills.

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
Mediumabout 2,097 tokens
Runs scripts
No, instructions only

What it does

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', 'consolidate what you learned', 'run the sleep cycle', or wants to schedule background self-optimization. Drives the skillopt_sleep engine: harvest past sessions -> mine recurring tasks -> replay through a selected backend -> consolidate validated CLAUDE.md/SKILL.md behind a held-out gate.

SkillOpt-Sleep: usage-driven self-evolution for a local Claude agent

SkillOpt-Sleep gives the user's agent a sleep cycle. On demand or on a nightly schedule, it reviews real past Claude Code sessions, re-runs recurring tasks through the selected backend, and consolidates what it learns into memory (CLAUDE.md) and skills (SKILL.md). With the default validation gate enabled, it keeps only changes that improve a held-out score. Live files change only through explicit adoption or a user-requested --auto-adopt. It aims to improve this user's recurring work, while making each accepted proposal measurable on the run's held-out tasks, with no model-weight training. It is the deployment-time analogue of training: short-term experience → long-term competence.

It synthesizes three ideas:

  • SkillOpt, the skill/memory doc is trainable text; bounded add/delete/replace edits; accepted only through a held-out gate; rejected edits are recorded in the run report for review.
  • Claude Dreams, consolidation that reads past sessions and proposes changes inside protected learned blocks; the input is never mutated, and output is reviewed before adoption.
  • Agent sleep, periodic background replay turns episodes into durable skill.

When to use this skill

Trigger when the user wants any of:

  • "make my agent learn from how I use it" / "get better the more I use it" / "remember my preferences across sessions"
  • a nightly/scheduled or on-demand offline self-improvement / dream / sleep run
  • to review past sessions/trajectories and distill recurring tasks
  • to consolidate feedback into CLAUDE.md or a managed skill
  • to schedule the cycle (cron) or adopt a staged proposal

The cycle (six stages)

Read the whole SKILL.md on GitHub

More in AI and agents