# Offline Skill Self-Improvement

Reviews past sessions and consolidates memory and skills in a dry-run-first cycle.

- Repository: https://github.com/microsoft/SkillOpt (18804 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add microsoft/SkillOpt --skill skillopt-sleep -g -a claude-code -y`
Codex: `npx skills add microsoft/SkillOpt --skill skillopt-sleep -g -a codex -y`
Cursor: `npx skills add microsoft/SkillOpt --skill skillopt-sleep -g -a cursor -y`
Gemini CLI: `npx skills add microsoft/SkillOpt --skill skillopt-sleep -g -a gemini-cli -y`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

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

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.

## When to use

Trigger when the user wants any of:

- 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;
- to consolidate feedback into memory or managed skills;
- to run `status`, `harvest`, `dry-run`, `run`, or `adopt` for SkillOpt-Sleep.

## The cycle

The rest: https://github.com/microsoft/SkillOpt/blob/HEAD/plugins/codex/skills/skillopt-sleep/SKILL.md
