Source profileQuality 85/100Review permissions

microsoft/SkillOpt/plugins/claude-code/skills/skillopt-sleep/SKILL.md

skillopt-sleep

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 -> co

Source repository stars
15,577
Declared platforms
0
Static risk flags
1
Last source update
2026-08-02
Source checked
2026-08-04

Decision brief

What it does—and where it fits

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 defau…

Best for

  • "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

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/microsoft/SkillOpt --skill "plugins/claude-code/skills/skillopt-sleep"
Safe inspection promptEditorial

Inspect the Agent Skill "skillopt-sleep" from https://github.com/microsoft/SkillOpt/blob/8a4c96a23639eee6ce19de7579ac9006b6dd4a2a/plugins/claude-code/skills/skillopt-sleep/SKILL.md at commit 8a4c96a23639eee6ce19de7579ac9006b6dd4a2a. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    How to drive it

    Prefer the /skillopt-sleep command. Under the hood it calls the bundled runner:

    Default backend is mock (deterministic, no API spend) — good for trying the plumbing.Add --backend claude or --backend codex to spend the user's real budgetScope defaults to the invoked project; --scope all harvests every Claude
  2. 02

    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 d…

    "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 runto review past sessions/trajectories and distill recurring tasks
  3. 03

    The cycle (six stages)

    1. Harvest — read /.claude/projects//.jsonl + /.claude/history.jsonl (READ-ONLY) → session digests. 2. Mine — digests → TaskRecords (recurring intents + outcome labels + checkable refs where possible). 3. Replay — re-run tasks through the selected backend under the current skill…

    Harvest — read /.claude/projects//.jsonl + /.claude/history.jsonl (READ-ONLY) → session digests.Mine — digests → TaskRecords (recurring intents + outcome labels + checkable refs where possible).Replay — re-run tasks through the selected backend under the current
  4. 04

    Scheduling

    Installs a nightly cron entry. unschedule --all removes every managed entry.

    Installs a nightly cron entry. unschedule --all removes every managed entry.
  5. 05

    Common CLI flags

    The CLI also has source/runtime path overrides (--claude-home, --codex-home, and --codex-path) and action-specific flags. Use python -m skilloptsleep --help as the authoritative surface.

    The CLI also has source/runtime path overrides (--claude-home, --codex-home, and --codex-path) and action-specific flags. Use python -m skilloptsleep --help as the authoritative surface.

Permission review

Static risk signals and limitations

Runs scripts

medium · line 146

The documentation asks the agent to run terminal commands or scripts.

python -m skillopt_sleep.experiments.run_experiment --persona researcher --assert-improves

Runs scripts

medium · line 147

The documentation asks the agent to run terminal commands or scripts.

python -m skillopt_sleep.experiments.run_experiment --persona programmer --assert-improves

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score85/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars15,577SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
microsoft/SkillOpt
Skill path
plugins/claude-code/skills/skillopt-sleep/SKILL.md
Commit
8a4c96a23639eee6ce19de7579ac9006b6dd4a2a
License
MIT
Collected
2026-08-04
Default branch
main
View the original SKILL.md

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)

  1. Harvest — read ~/.claude/projects/*/<session>.jsonl + ~/.claude/history.jsonl (READ-ONLY) → session digests.
  2. Mine — digests → TaskRecords (recurring intents + outcome labels + checkable refs where possible).
  3. Replay — re-run tasks through the selected backend under the current skill+memory → (hard, soft) scores.
  4. Consolidate — reflect on failures → propose bounded edits → gate on a held-out slice; with the default gate enabled, accept only if it strictly improves.
  5. Stage — write the accepted proposed_CLAUDE.md and/or proposed_SKILL.md, plus report.md, report.json, manifest.json, and diagnostics.json into <project>/.skillopt-sleep/staging/<timestamp>/. Nothing live changes. A rejected run still has a report but no proposed live-file replacement.
  6. Adopt — explicit (or opt-in auto): copy staged files over live ones, backing up first.

How to drive it

Prefer the /skillopt-sleep command. Under the hood it calls the bundled runner:

"${CLAUDE_PLUGIN_ROOT}/scripts/sleep.sh" status                       # what's happened
"${CLAUDE_PLUGIN_ROOT}/scripts/sleep.sh" dry-run --project "$(pwd)"    # no-staging preview
"${CLAUDE_PLUGIN_ROOT}/scripts/sleep.sh" run --project "$(pwd)"        # full cycle, stages a proposal
"${CLAUDE_PLUGIN_ROOT}/scripts/sleep.sh" adopt --project "$(pwd)"      # apply staged proposal (with backup)
  • Default backend is mock (deterministic, no API spend) — good for trying the plumbing.
  • Add --backend claude or --backend codex to spend the user's real budget for model-driven optimization. A held-out gain is run-specific evidence, not a guarantee of broader improvement; results depend on the tasks, model, and checks.
  • Scope defaults to the invoked project; --scope all harvests every Claude project into the current run's configured targets.
  • A real backend sends truncated transcript/task content to its provider. See the data-boundary rules below before using one with sensitive sessions.

Scheduling

"${CLAUDE_PLUGIN_ROOT}/scripts/sleep.sh" schedule --project "$(pwd)" --hour 3 --minute 17
"${CLAUDE_PLUGIN_ROOT}/scripts/sleep.sh" unschedule --project "$(pwd)"

Installs a nightly cron entry. unschedule --all removes every managed entry.

Common CLI flags

FlagDefaultDescription
--project PATHcwdProject directory to evolve
--scope all|invokedinvokedHarvest scope
--backend mock|claude|codex|copilot|handoff|azure_openaimockBackend (mock = no provider calls)
--model NAMEbackend defaultOverride the model used for replay
--source claude|codex|autoclaudeTranscript source
--lookback-hours N72Harvest window
--max-sessions NderivedCap harvested sessions; defaults to 3 × max tasks (120 with current defaults)
--max-tasks N40Cap mined tasks
--target-skill-path PATH~/.claude/skills/skillopt-sleep-learned/SKILL.mdExplicit SKILL.md to evolve
--tasks-file PATHReviewed TaskRecord JSON (skip harvest)
--progressoffPrint phase progress to stderr
--auto-adoptoffAuto-adopt if gate passes
--edit-budget N4Max bounded edits per night
--preferences TEXTemptyAdd house rules to the optimizer's reflection prior
--jsonoffMachine-readable JSON output

The CLI also has source/runtime path overrides (--claude-home, --codex-home, and --codex-path) and action-specific flags. Use python -m skillopt_sleep <action> --help as the authoritative surface.

Config keys (~/.skillopt-sleep/config.json)

Beyond the CLI flags, advanced behavior is controlled via config:

  • preferences — free-text house rules injected into the optimizer's reflect step (e.g. "Always use async/await", "Answers in \boxed{}").
  • gate_modeon (default, validation-gated) or off (greedy, accept all edits).
  • gate_metrichard, soft, or mixed (default). Controls how the held-out gate scores.
  • dream_rollouts — >1 enables multi-rollout contrastive reflection per task.
  • recall_k — >0 recalls K similar past tasks into the dream (long-term memory).
  • evolve_memory / evolve_skill — independently toggle CLAUDE.md vs SKILL.md consolidation.

Memory consolidation

The sleep cycle can consolidate both:

  • SKILL.md — the managed skill file (bounded edits: add/delete/replace)
  • CLAUDE.md — the project memory (same bounded edits)

With the default gate enabled, both are evaluated by the same held-out score. Set evolve_memory: false to consolidate only skills, or evolve_skill: false for only memory.

Hard rules

  • Never hand-edit the user's CLAUDE.md / SKILL.md as part of this skill. Let the engine's explicit adopt or user-requested --auto-adopt path apply the staging manifest and back up existing live files first.
  • Harvest is read-only. mock replay has no side effects.
  • Real backends send truncated transcript excerpts and derived tasks to the selected provider for mining, replay, judging, and reflection. The Claude transcript path is not guaranteed to remove every secret before those calls. Review provider policy and session contents first. For sensitive data, use mock or run harvest --output <file>, inspect/redact the JSON, set "reviewed": true, and replay it with --tasks-file; real backends refuse an unreviewed task file.
  • Always show the user the held-out baseline → candidate score and the exact proposed edits before suggesting adoption. Evidence before adoption.
  • If asked to demonstrate the mechanism without provider calls, run python -m skillopt_sleep.experiments.run_experiment --persona researcher --json — a deterministic synthetic demo of held-out lift and gate rejection. It validates the mechanism, not effectiveness on the user's own tasks.

Validate / demo

# deterministic synthetic demo (no API): score rises and the gate blocks a regression
python -m skillopt_sleep.experiments.run_experiment --persona researcher --assert-improves
python -m skillopt_sleep.experiments.run_experiment --persona programmer  --assert-improves

See the SkillOpt-Sleep documentation for recorded results, limitations, and the supported integration surface.

Alternatives

Compare before choosing

Computed 8915,577

microsoft/SkillOpt

skillopt-sleep

Use when the user wants Codex to self-improve from past usage, asks about a nightly/offline 'sleep' or 'dream' cycle, wants Codex to review past sessions, learn preferences, consolidate memory/skills, run dry-run/run/adopt/status for SkillOpt-Sleep, or schedule background self-optimization. Drives the skillopt_sleep engine: harvest past sessions -> mine recurring tasks -> replay through a selected backend -> consolidate validated memory + skills behind a held-out gate.

Computed 10042,968

coreyhaines31/marketingskills

ab-testing

When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program

Computed 10023,781

alirezarezvani/claude-skills

app-store-optimization

App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist

Computed 1004,922

dotnet/skills

migrate-vstest-to-mtp

Migrates .NET test projects from VSTest to Microsoft.Testing.Platform (MTP). Use when user asks to "migrate to MTP", "switch from VSTest", "enable Microsoft.Testing.Platform", "use MTP runner", set OutputType=Exe only for test projects in Directory.Build.props, or mentions EnableMSTestRunner, EnableNUnitRunner, or UseMicrosoftTestingPlatformRunner. USE FOR: MTP behavioral differences vs VSTest (exit code 8, zero tests discovered, --ignore-exit-code, TESTINGPLATFORM_EXITCODE_IGNORE); centralizing