Skip to content
SkillModel-led2,081 tokens in use

SkillOpt Sleep for Claude Code

Gives Claude Code a sleep cycle: it reads past sessions, replays recurring tasks and stages CLAUDE.md and SKILL.md edits that beat a held-out score.

19,169 stars on the repository MIT Licensemicrosoft/SkillOpt · plugins/claude-code/skills/skillopt-sleep

Skill label

measured from its files

What installing SkillOpt Sleep for Claude Code costs

131tokens idle
2,081tokens in use

Idle is what sits in context while the skill is installed. In use is its instructions, loaded when it runs. Counts are approximate, made offline with cl100k_base.

Model dependence Model-led

Script-ledMixedModel-led

Mostly instructions, so how well it works depends on the model that follows them.

This describes the skill's structure, how much of it is scripts. It does not say how well it works.

Touches

shelldetected

Declared tags come from the skill's frontmatter; detected ones from its scripts, its code blocks and the commands it names in inline code. This is detected, not audited.

How it scores

Quality

How well the skill is written, counted from its own files: its frontmatter, its steps, examples, stated output and constraints, its size and whether every file it ships is one it names.How we score it →
Excellent
  • Frontmatter12/15
  • Structure25/25
  • Examples12/15
  • Output15/15
  • Size13/15
  • Resources10/15

Security

Starts at 100 and loses points for each thing in the skill's files that a reader should look at first.How we score it →
Excellent
  • Runs shell commands−5

    does this on the machine, and the frontmatter does not say so

    SKILL.md, line 56

Repository health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
Good
  • Development activity96
  • Maintenance84
  • Community68
  • Maturity28
  • Momentum40

SkillOpt Sleep for Claude Code drives the skillopt_sleep engine from a skill. It harvests past Claude Code sessions, mines recurring tasks, replays them through a chosen backend and proposes small edits to CLAUDE.md and a managed SKILL.md.

With the default gate on, an edit is kept only when it improves a held-out score. Proposals land in a staging folder, and live files change only when you adopt them or ask for auto-adopt.

What You Get

  • A six-stage cycle: harvest, mine, replay, consolidate, stage and adopt
  • Staged proposals (proposed CLAUDE.md, proposed SKILL.md, report and manifest files) that leave live files alone until adopted
  • Commands for status, dry-run, run, adopt, schedule and unschedule
  • A default mock backend that spends no API budget, plus claude and codex backends for real optimization runs

Common Use Cases

  • Let Claude Code pick up your recurring preferences from past sessions and write them into CLAUDE.md
  • Run a nightly review of the last 72 hours of work and look at the staged report in the morning
  • Preview a cycle with the mock backend before spending any budget
  • Try the bundled synthetic demo that shows a held-out score rising and the gate rejecting a regression

What Makes It Unique

Edits are bounded add, delete and replace operations, and each one has to improve a held-out score before it is proposed. The skill also tells the agent to show the baseline and candidate scores and the exact edits before suggesting adoption, and forbids hand-editing CLAUDE.md or SKILL.md around the engine’s backup-first adopt step.

Under The Hood

The skill is prose that tells the agent to run a bundled shell script (sleep.sh) with a subcommand, which starts the Python skillopt_sleep engine. Harvesting reads session files under the Claude home folder and the history file, read-only. A real backend (claude, codex, copilot, azure_openai) sends truncated transcript excerpts and derived tasks to that provider, and the skill warns that secret redaction is pattern-based; for sensitive sessions it describes exporting tasks, reviewing them and replaying from a reviewed file. The run writes staging files inside the project folder. Adopt copies the staged files over CLAUDE.md and the managed SKILL.md after making a backup. The schedule command installs a nightly cron entry.

Join founders building with open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on SubstackJoin 750+ subscribers