SkillOpt Sleep Cycle
microsoft/SkillOpt
Runs an on-demand or nightly sleep cycle that reviews past Claude Code sessions and proposes validated updates to CLAUDE.md and skills.
A skill your agent uses 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…
$ npx skills add alirezarezvani/claude-skills --skill skillopt-sleep -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install alirezarezvani/claude-skills skillopt-sleep --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/alirezarezvani/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/engineering/skillopt-sleep/skills/skillopt-sleep .claude/skills/skillopt-sleep && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "skillopt-sleep" agent skill from https://github.com/alirezarezvani/claude-skills/tree/main/engineering/skillopt-sleep/skills/skillopt-sleep into .claude/skills/skillopt-sleep/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "skillopt-sleep", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/alirezarezvani/claude-skills/tree/main/engineering/skillopt-sleep/skills/skillopt-sleepType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add alirezarezvani/claude-skills --skill skillopt-sleep -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install alirezarezvani/claude-skills skillopt-sleep --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/alirezarezvani/claude-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/engineering/skillopt-sleep/skills/skillopt-sleep .agents/skills/skillopt-sleep && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "skillopt-sleep" agent skill from https://github.com/alirezarezvani/claude-skills/tree/main/engineering/skillopt-sleep/skills/skillopt-sleep into .agents/skills/skillopt-sleep/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "skillopt-sleep", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add alirezarezvani/claude-skills --skill skillopt-sleep -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install alirezarezvani/claude-skills skillopt-sleep --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/alirezarezvani/claude-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/engineering/skillopt-sleep/skills/skillopt-sleep .cursor/skills/skillopt-sleep && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "skillopt-sleep" agent skill from https://github.com/alirezarezvani/claude-skills/tree/main/engineering/skillopt-sleep/skills/skillopt-sleep into .cursor/skills/skillopt-sleep/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "skillopt-sleep", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/alirezarezvani/claude-skills.git --path engineering/skillopt-sleep/skills/skillopt-sleep--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add alirezarezvani/claude-skills --skill skillopt-sleep -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install alirezarezvani/claude-skills skillopt-sleep --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/alirezarezvani/claude-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/engineering/skillopt-sleep/skills/skillopt-sleep .gemini/skills/skillopt-sleep && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "skillopt-sleep" agent skill from https://github.com/alirezarezvani/claude-skills/tree/main/engineering/skillopt-sleep/skills/skillopt-sleep into .gemini/skills/skillopt-sleep/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "skillopt-sleep", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install alirezarezvani/claude-skills skillopt-sleepInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add alirezarezvani/claude-skills --skill skillopt-sleep -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/alirezarezvani/claude-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/engineering/skillopt-sleep/skills/skillopt-sleep .github/skills/skillopt-sleep && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "skillopt-sleep" agent skill from https://github.com/alirezarezvani/claude-skills/tree/main/engineering/skillopt-sleep/skills/skillopt-sleep into .github/skills/skillopt-sleep/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "skillopt-sleep", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add alirezarezvani/claude-skills --skill skillopt-sleep -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install alirezarezvani/claude-skills skillopt-sleep --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/alirezarezvani/claude-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/engineering/skillopt-sleep/skills/skillopt-sleep .opencode/skills/skillopt-sleep && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "skillopt-sleep" agent skill from https://github.com/alirezarezvani/claude-skills/tree/main/engineering/skillopt-sleep/skills/skillopt-sleep into .opencode/skills/skillopt-sleep/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "skillopt-sleep", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skillopt-sleepA skill your agent uses 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…
Skillopt Sleep is an agent skill from alirezarezvani/claude-skills. 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 offline self-optimization. Drives the skilloptsleep engine: harvest past sessions - mine recurring tasks - replay offline - consolidate validated CLAUDE.md and SKILL.md…
Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Agent Workflows, covering Scheduled and recurring tasks and Agent instruction files. The repository describes itself as: 380 Claude Code skills & agent skills & plugins (30+ Agents, 70+ custom commands, 380+ skills, customizable references, scripts)for Claude Code, Codex, Gemini CLI, Cursor, and 8… The licence is MIT.
6 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 19392f7. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
pythonFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
microsoft.github.ioFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Skillopt Sleep loads about 1.8k tokens when it runs. Until then it costs about 140 tokens; SKILL.md has 713 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from alirezarezvani/claude-skills at commit 19392f7, republished under its MIT licence (© alirezarezvani). 713 words, ~1,793 tokens.
.claude/skills/skillopt-sleep/SKILL.md (or your agent's skills folder).SkillOpt-Sleep gives the user's agent a sleep cycle. While the user is
offline (e.g. nightly), it reviews their real past Claude Code sessions,
re-runs recurring tasks on their own API budget, and consolidates what it
learns into memory (CLAUDE.md) and skills (SKILL.md) — but only
keeps changes that pass a held-out validation gate, and only after the user
adopts them. The agent gets measurably better at this user's recurring work,
with no model-weight training. It is the deployment-time analogue of training:
short-term experience → long-term competence.
It synthesizes three ideas:
Trigger when the user wants any of:
CLAUDE.md or a managed skill~/.claude/projects/*/<session>.jsonl + ~/.claude/history.jsonl (READ-ONLY) → session digests.TaskRecords (recurring intents + outcome labels + checkable refs where possible).proposed_CLAUDE.md, proposed_SKILL.md, a diff, and report.md into <project>/.skillopt-sleep/staging/<date>/. Nothing live changes.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)" # safe 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)mock (deterministic, no API spend) — good for trying the plumbing.--backend claude or --backend codex to spend the user's real budget for genuine improvement.--scope all harvests every project."${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.
| Flag | Default | Description |
|---|---|---|
--project PATH | cwd | Project directory to evolve |
--scope all|invoked | invoked | Harvest scope |
--backend mock|claude|codex|copilot | mock | Replay backend (mock = no API spend) |
--model NAME | backend default | Override the model used for replay |
--source claude|codex|auto | claude | Transcript source |
--lookback-hours N | 72 | Harvest window |
--max-sessions N | unlimited | Cap harvested sessions |
--max-tasks N | 40 | Cap mined tasks |
--target-skill-path PATH | auto | Explicit SKILL.md to evolve |
--tasks-file PATH | — | Reviewed TaskRecord JSON (skip harvest) |
--progress | off | Print phase progress to stderr |
--auto-adopt | off | Auto-adopt if gate passes |
--edit-budget N | 4 | Max bounded edits per night |
--json | off | Machine-readable JSON output |
~/.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_mode — on (default, validation-gated) or off (greedy, accept all edits).gate_metric — hard, 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.The sleep cycle can consolidate both:
Both are gated by the same held-out validation score. Set evolve_memory: false to consolidate only skills, or evolve_skill: false for only memory.
CLAUDE.md / SKILL.md as part of this skill.
Only the adopt action changes live files, and it backs them up first.mock replay has no side effects.python -m skillopt_sleep.experiments.run_experiment --persona researcher --json
— a deterministic demo that proves held-out lift and that the gate blocks
harmful edits.# deterministic proof (no API): held-out score rises, gate blocks regressions
python -m skillopt_sleep.experiments.run_experiment --persona researcher --assert-improves
python -m skillopt_sleep.experiments.run_experiment --persona programmer --assert-improvesSee the upstream SkillOpt-Sleep guide section
(https://microsoft.github.io/SkillOpt/docs/guideline.html#sleep) for recorded
output and the full design. (The original repo-relative design-doc path,
docs/superpowers/specs/..., is not vendored into this repo — see this
skill's README.md "What was and wasn't vendored" table.)
© alirezarezvani, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in engineering/skillopt-sleep/skills/skillopt-sleep of alirezarezvani/claude-skills.
Open the folder on GitHubat commit 19392f7
Skillopt Sleep next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Skillopt Sleep this skillalirezarezvani/claude-skills | 28k | — | ~1.8k | Automated safety check: Pass | MIT | |
| SkillOpt Sleep Cyclemicrosoft/SkillOpt | 18k | — | ~2.3k | Automated safety check: Pass | MIT | |
| Self ImprovementCraftOS-dev/CraftBot | 392 | 5 repos | ~4.9k | Automated safety check: Pass | MIT | |
| Wp Plugin Developmentgambitph/Stackable | 350 | 3 repos | ~999 | Automated safety check: Pass | GPL-3.0 | |
| Self Improvementpskoett/pskoett-ai-skills | 311 | — | ~5k | Automated safety check: Pass | None | |
| Harness 24hthu-nmrc/OpenHarness | 116 | — | ~3.6k | Automated safety check: Pass | Apache-2.0 |
microsoft/SkillOpt
Runs an on-demand or nightly sleep cycle that reviews past Claude Code sessions and proposes validated updates to CLAUDE.md and skills.
CraftOS-dev/CraftBot
Captures learnings, errors, and corrections to enable continuous improvement.
gambitph/Stackable
A skill your agent uses when developing WordPress plugins: architecture and hooks, activation/deactivation/uninstall, admin UI and Settings API, data storage, cron/tasks, security…
pskoett/pskoett-ai-skills
Captures learnings, errors, corrections, and feature requests to enable continuous improvement.
thu-nmrc/OpenHarness
A production-grade framework for long-running, autonomous agents based on Harness Engineering principles.
pskoett/pskoett-ai-skills
Captures learnings, errors, corrections, and feature requests to enable continuous improvement.
alirezarezvani/claude-skills
Writes INVEST-checked user stories with acceptance criteria, splits epics, plans sprints from velocity and ranks the backlog with a weighted score.
alirezarezvani/claude-skills
OKR cascade toolkit for product leaders: generates aligned company-to-team OKRs from five strategy types and scores how well they line up.
alirezarezvani/claude-skills
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.
alirezarezvani/claude-skills
Design AWS architectures for startups using serverless patterns and IaC templates.
alirezarezvani/claude-skills
Calculates attribution, funnel and ROI figures for marketing campaigns with three Python scripts that need only the standard library.
alirezarezvani/claude-skills
Reverse-engineers a frontend, backend or fullstack codebase into a product requirements document with per-page docs, an enum dictionary and an API inventory.
Categories
A skill your agent uses 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…. Skillopt Sleep is an agent skill from alirezarezvani/claude-skills. 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 offline self-optimization.
Skillopt Sleep fits situations like: the user wants their Claude agent to self-improve from past usage; asks about a nightly/offline sleep; memory/skill consolidation; says things like make my agent better the more I use it.
Run `npx skills add alirezarezvani/claude-skills --skill skillopt-sleep -a claude-code`. Or copy the skill folder (engineering/skillopt-sleep/skills/skillopt-sleep in alirezarezvani/claude-skills) into .claude/skills/skillopt-sleep in your project. Claude Code loads it when a task matches its description.
Run `npx skills add alirezarezvani/claude-skills --skill skillopt-sleep -a codex`. Or copy the skill folder (engineering/skillopt-sleep/skills/skillopt-sleep in alirezarezvani/claude-skills) into .agents/skills/skillopt-sleep in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add alirezarezvani/claude-skills --skill skillopt-sleep -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/skillopt-sleep, .gemini/skills/skillopt-sleep, .github/skills/skillopt-sleep and .opencode/skills/skillopt-sleep in your project.
Going by SKILL.md and its folder, Skillopt Sleep needs the command-line tools its instructions call (python). Our summary lists: Python 3.
SKILL.md names 1 domain. As links in the text: microsoft.github.io. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Skillopt Sleep is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.8k tokens (SKILL.md is roughly 7.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Skillopt Sleep: SkillOpt Sleep Cycle (microsoft/SkillOpt, 18k stars), Self Improvement (CraftOS-dev/CraftBot, 392 stars), Wp Plugin Development (gambitph/Stackable, 350 stars) and Self Improvement (pskoett/pskoett-ai-skills, 311 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
alirezarezvani (a GitHub user) maintains it in alirezarezvani/claude-skills, which has 27,829 GitHub stars. The repository holds 342 skills in this directory. The repository was last updated on August 30, 2026.
Source: alirezarezvani/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.