Dev & Engineering ✓ Microsoft · Official self-improvementagent-trainingnightly-schedulingvalidation-gatesession-harvestingmemory-consolidationcodexcli

SkillOpt-Sleep

Gives your local Codex agent a 'sleep cycle': it reviews past sessions offline, replays recurring tasks, and adopts skill and memory edits only when a held-out validation score improves — no model-weight training.

FollowSkills review · FSRS-1.0
Recommended
64/ 100 5-point scale 3.2 / 5
This review was completed under FSRS 1.0. Dimension scores are not converted; it is queued for re-review under FSRS 2.0.
1 2 3 4 5 6
1Utility14 / 20 · 3.5/5
2Reliability13 / 20 · 3.3/5
3Safety15 / 25 · 3.0/5

Same as above, the Codex platform adaptation, with the same self-modification-plus-validation-gate design.

4Evidence7 / 15 · 2.3/5
5Usability7 / 10 · 3.5/5
6Maintenance8 / 10 · 4.0/5
Evidence confidence:Low Reviewed Jul 17, 2026
Review evidence [1]
See the full review method →

What does this skill do, and when should you use it?

SkillOpt-Sleep is a skill in Microsoft's SkillOpt repository that provides nightly or on-demand offline self-evolution for frozen LLM agents. It runs a seven-stage cycle — harvest, mine, replay, consolidate, gate, stage, adopt: reading local session transcripts, distilling recurring tasks, replaying them through a selected backend, and proposing bounded edits to a target skill file and the project's CLAUDE.md. With the default validation gate enabled, changes are accepted only when the held-out validation score improves; live files change only through explicit adoption or an explicitly requested --auto-adopt. It trains no model weights — the deployed artifact is a plain-text skill document.

Reads Codex archived sessions from ~/.codex/archived_sessions (harvest is read-only); mines digests into recurring TaskRecords with outcomes and checkable references; replays tasks through one of six backends (mock, claude, codex, copilot, handoff, azure_openai); reflects on failures and proposes bounded edits; gates them on held-out validation improvement; writes proposals to <project>/.skillopt-sleep/staging/<date>/; and overwrites live files only on explicit adopt (which backs up existing targets first). Supports status/harvest/dry-run/run/adopt/schedule/unschedule actions, flags like --edit-budget, --lookback-hours, --auto-adopt and --, and crontab-based scheduling.

  1. A developer who uses Codex heavily every day and wants the agent to keep learning from its own past sessions
  2. A team wanting unattended overnight self-optimization via a scheduled 3 a.m. run
  3. A user who wants data-driven improvements to their project skill file (.agents/skills/<name>/SKILL.md) but requires every change to pass a validation gate first
  4. A cost-conscious user testing the waters with the deterministic, zero-API-cost mock backend and dry-run
  5. A user maintaining project conventions in CLAUDE.md who wants session feedback consolidated into that memory file

What are this skill's strengths and limitations?

Pros
  • Default validation gate keeps only edits that genuinely improve held-out scores — weight-training discipline with zero inference-time overhead
  • Stage-only by default with backup-on-adopt gives a clear safety boundary
  • Deterministic mock backend costs nothing and enables safe smoke tests
  • Six backends, cross-platform runners (Linux/macOS shell, CMD/PowerShell), and crontab scheduling
  • Harvest is read-only, with pattern-based redaction of secret-shaped strings, developer instructions, and raw tool payloads
Limitations
  • A passed gate is run-specific evidence only — no guarantee of broader improvement for other skills, tasks, or models
  • Redaction is pattern-based and not a guarantee; real backends still send truncated transcript content to their provider, so data-boundary-sensitive users must be careful
  • The shared engine does not write AGENTS.md, and the scheduler does not persist --source or --target-skill-path, requiring manual config. edits
  • On systems without crontab, schedule just prints a line for manual installation
  • The 0.00→1.00 result comes from a single recorded run on one fixture (brief-writer gbrain) — limited evidence

How do you install this skill?

This skill lives in the microsoft/SkillOpt repository (MIT license) at plugins/codex/skills/skillopt-sleep/SKILL.md. The repo ships as the skillopt package on PyPI as of v0.2.0 (pip install skillopt), but this sleep skill is invoked via the in-repo runner (bash plugins/run-sleep.sh). Clone the repository and set SKILLOPT_SLEEP_REPO to its path; Python >= 3.10 is located automatically by the runner. The exact steps for installing the skill into a Codex client for scheduled use are not detailed in the source.

How do you use this skill?

1) export SKILLOPT_SLEEP_REPO=/path/to/SkillOpt and pick a target, e.g. TARGET_SKILL=.agents/skills/example/SKILL.md (Codex skills require --target-skill-path explicitly). 2) Smoke test first: bash "$SKILLOPT_SLEEP_REPO/plugins/run-sleep.sh" dry-run --project "$(pwd)" --source codex --target-skill-path "$TARGET_SKILL" --backend mock. 3) Real run: switch to --backend codex and optionally add --max-sessions, --max-tasks, --progress. 4) Review the staged report.md, then adopt explicitly. 5) Nightly scheduling: schedule --backend codex --hour 3 --minute 17 (after setting transcript_source and an absolute target_skill_path in ~/.skillopt-sleep/config.). Windows runners exist (run-sleep.cmd / run-sleep.ps1).

How does this skill compare with similar options?

Within the same repository, SkillOpt's main training loop (rollout→reflect→aggregate→select→update→evaluate) treats the skill document as trainable state and produces best_skill.md; SkillOpt-Sleep is its nightly offline self-evolution variant, distinguished by session harvesting and a validation-gated nightly pipeline. Compared with hand-maintaining skill files or one-shot LLM skill generation, Sleep requires edits to pass a held-out validation gate.

FAQ

How much does a run cost?
The default --backend mock is deterministic and spends no API budget; --backend codex uses your own Codex budget, bounded by --max-sessions, --max-tasks, and --edit-budget (max 4 bounded edits per night by default).
Will it silently change my files?
No. run stages proposals only; live files change on explicit adopt or an explicitly supplied --auto-adopt, and adoption backs up existing targets first.
Can it also update my Codex skills via AGENTS.md?
No. The current shared engine does not write AGENTS.md. For a Codex-visible result, select a Codex skill explicitly with --target-skill-path. CLAUDE.md as a secondary memory target can be disabled with evolve_memory: false.
Is my sensitive session data safe?
Harvest is read-only and redacts known secret-shaped strings, developer instructions, and raw tool payloads, but this is pattern-based and not a guarantee. Real backends still send truncated content to their provider; for strict data boundaries, review sensitive sessions first or use the --tasks-file workflow.

More skills from this repository

All from microsoft/SkillOpt

Related skills