Best for
- Codex to learn from past sessions or get better the more they use it;
- a nightly/scheduled or on-demand sleep/dream/offline self-improvement run;
- to review past sessions and distill recurring tasks;
microsoft/SkillOpt/plugins/codex/skills/skillopt-sleep/SKILL.md
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.
Decision brief
SkillOpt-Sleep gives the user's Codex agent a sleep cycle. On demand or on a nightly schedule, it reviews past local sessions, re-runs recurring tasks through the selected backend, and proposes changes to a configured skill and to the project's CLAUDE.md. With the default valida…
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Declared | Source record | Install path and trigger |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/microsoft/SkillOpt --skill "plugins/codex/skills/skillopt-sleep"Inspect the Agent Skill "skillopt-sleep" from https://github.com/microsoft/SkillOpt/blob/8a4c96a23639eee6ce19de7579ac9006b6dd4a2a/plugins/codex/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
Invoke the bundled runner via shell (Codex exec has shell access). The runner finds the engine and a Python = 3.10 automatically.
Trigger when the user wants any of:
1. Harvest - read local session transcripts according to the engine configuration and normalize them into session digests. 2. Mine - turn digests into recurring TaskRecords with outcomes and checkable references where possible. 3. Replay - re-run mined tasks through the selected…
export SKILLOPTSLEEPREPO=/path/to/SkillOpt TARGETSKILL=.agents/skills/example/SKILL.md bash "$SKILLOPTSLEEPREPO/plugins/run-sleep.sh" status --project "$(pwd)" bash "$SKILLOPTSLEEPREPO/plugins/run-sleep.sh" harvest --project "$(pwd)" \ --source codex --target-skill-path "$TARGET…
$env:SKILLOPTSLEEPREPO = "C:\path\to\SkillOpt-Sleep" powershell -File "$env:SKILLOPTSLEEPREPO\plugins\run-sleep.ps1" status --project "$(pwd)" bash bash "$SKILLOPTSLEEPREPO/plugins/run-sleep.sh" schedule --project "$(pwd)" \ --backend codex --hour 3 --minute 17 bash "$SKILLOPTSL…
Permission review
The documentation asks the agent to run terminal commands or scripts.
Invoke the bundled runner via shell (Codex `exec` has shell access). The runnerThe documentation asks the agent to run terminal commands or scripts.
bash "$SKILLOPT_SLEEP_REPO/plugins/run-sleep.sh" status --project "$(pwd)"Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 89/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 15,577 | Source | Repository attention, not individual Skill quality |
| Compatibility | 1 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
SkillOpt-Sleep gives the user's Codex agent a sleep cycle. On demand or on a
nightly schedule, it reviews past local sessions, re-runs recurring tasks
through the selected backend, and proposes changes to a configured skill and to
the project's CLAUDE.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. There is no model-weight
training.
The current shared engine does not write AGENTS.md. For a Codex-visible
result, always select a Codex skill explicitly with --target-skill-path (for
example .agents/skills/<name>/SKILL.md). If project CLAUDE.md is not a
desired secondary target, set "evolve_memory": false in
~/.skillopt-sleep/config.json before running.
Trigger when the user wants any of:
status, harvest, dry-run, run, or adopt for SkillOpt-Sleep.TaskRecords with outcomes and
checkable references where possible.<project>/.skillopt-sleep/staging/<date>/; nothing live changes.Invoke the bundled runner via shell (Codex exec has shell access). The runner
finds the engine and a Python >= 3.10 automatically.
# point at the repo if it isn't auto-detected from CWD:
export SKILLOPT_SLEEP_REPO=/path/to/SkillOpt
TARGET_SKILL=.agents/skills/example/SKILL.md
bash "$SKILLOPT_SLEEP_REPO/plugins/run-sleep.sh" status --project "$(pwd)"
bash "$SKILLOPT_SLEEP_REPO/plugins/run-sleep.sh" harvest --project "$(pwd)" \
--source codex --target-skill-path "$TARGET_SKILL"
bash "$SKILLOPT_SLEEP_REPO/plugins/run-sleep.sh" dry-run --project "$(pwd)" \
--source codex --target-skill-path "$TARGET_SKILL" --backend mock
bash "$SKILLOPT_SLEEP_REPO/plugins/run-sleep.sh" run --project "$(pwd)" \
--source codex --target-skill-path "$TARGET_SKILL" --backend codex \
--max-sessions 5 --max-tasks 3 --progress
bash "$SKILLOPT_SLEEP_REPO/plugins/run-sleep.sh" adopt --project "$(pwd)"
On Windows (CMD / PowerShell):
:: CMD
set SKILLOPT_SLEEP_REPO=C:\path\to\SkillOpt-Sleep
"%SKILLOPT_SLEEP_REPO%\plugins\run-sleep.cmd" status --project "%CD%"
# PowerShell
$env:SKILLOPT_SLEEP_REPO = "C:\path\to\SkillOpt-Sleep"
powershell -File "$env:SKILLOPT_SLEEP_REPO\plugins\run-sleep.ps1" status --project "$(pwd)"
Actions are status, harvest, dry-run, run, adopt, schedule, and unschedule.
mock, which is deterministic and spends no API budget.--backend codex uses the user's Codex budget for model-driven optimization.
An accepted held-out gain is run-specific evidence, not a guarantee of
broader improvement; results depend on the tasks, model, and checks.--source codex reads Codex Desktop archived sessions from ~/.codex/archived_sessions;
use --codex-home /path/to/.codex if the archive lives elsewhere.--target-skill-path is required for a Codex skill target. Without it, the
shared default is a Claude-managed skill under ~/.claude/skills/, not an
.agents skill.dry-run --backend mock as the first smoke check unless the user
explicitly asked for a real optimization run.bash "$SKILLOPT_SLEEP_REPO/plugins/run-sleep.sh" schedule --project "$(pwd)" \
--backend codex --hour 3 --minute 17
bash "$SKILLOPT_SLEEP_REPO/plugins/run-sleep.sh" unschedule --project "$(pwd)"
The scheduler persists the project, backend, time, and optional auto-adopt flag;
it does not persist --source or --target-skill-path from this command. Before
scheduling a Codex-targeted run, set "transcript_source": "codex" and an
absolute "target_skill_path" in ~/.skillopt-sleep/config.json. On systems
without crontab, schedule prints a line for manual installation.
unschedule --all removes every managed entry.
--backend mock — deterministic, no API spend (default)--backend claude — uses the Claude CLI--backend codex — uses the Codex CLI--backend copilot — uses the GitHub Copilot CLI--backend handoff — emits prompt/answer files for an interactive session--backend azure_openai — uses the configured Azure OpenAI endpoint| Flag | Description |
|---|---|
--auto-adopt | Auto-adopt if the gate passes (default: stage only) |
--edit-budget N | Max bounded edits per night (default: 4) |
--lookback-hours N | Harvest window in hours (default: 72) |
--json | Machine-readable JSON output |
~/.skillopt-sleep/config.json)preferences — free-text house rules for the optimizergate_mode — on (validation-gated, default) or off (greedy)gate_metric — hard | soft | mixed (default)dream_rollouts — >1 for multi-rollout contrastive reflectionrecall_k — >0 recalls similar past tasks from the archiveThe shared sleep cycle consolidates project memory (CLAUDE.md) and the
selected skill (SKILL.md) by default. It does not update AGENTS.md.
Each target is independently toggleable through evolve_memory /
evolve_skill, and both are gated by the same held-out validation score.
dry-run and run, report the held-out baseline -> candidate score,
gate action, task count, session count, and exact proposed edits.report.md before summarizing.run stages by default; if --auto-adopt was explicitly supplied, report
the paths it updated instead of claiming nothing changed.CLAUDE.md or target skill as a substitute
for the engine's adopt path; adoption is the safety boundary and backs up
existing targets first.--tasks-file workflow when the data boundary matters./sleep slash commands for this
Codex integration. This skill is the entrypoint.python -m skillopt_sleep dry-run --project "$(pwd)" --source codex \
--target-skill-path .agents/skills/example/SKILL.md --backend mock --json
python -m skillopt_sleep.experiments.run_gbrain --backend codex \
--seeds brief-writer --data-root /path/to/gbrain-evals/eval/data/skillopt-v1 \
--nights 2 --limit-replay 3 --limit-holdout 3
In the recorded brief-writer gbrain run, the deliberately deficient fixture
went 0.00 -> 1.00 on that run's held-out set. Treat this as reproducible
benchmark evidence for that configuration, not a guarantee for other skills,
tasks, or models; see the
recorded results
for context and limitations.
Alternatives
microsoft/SkillOpt
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
xiaolai/nlpm
Universal NL programming conventions — SKILL.md open spec (agentskills.io), AGENTS.md as canonical universal memory file, vague-quantifier list, prompt engineering layers, naming conventions, the override system. Tool-specific schemas live in nlpm:conventions-claude / nlpm:conventions-codex / nlpm:conventions-antigravity.
PramodDutta/qaskills
Generate optimized test combinations using pairwise (all-pairs) testing algorithms to achieve maximum coverage with minimum test cases across multiple input parameters
PramodDutta/qaskills
Gate RAG pipelines in CI with versioned golden eval sets, per-metric thresholds, baseline drift detection, and a build that fails when retrieval or answer quality regresses.