Neat-Freak Knowledge Closeout
KKKKhazix/khazix-skills
Brings project docs, agent rule files, authorized memory and leftover workspace files back in line with what the code and runtime actually do at the end of a work session.
Runs an on-demand or nightly sleep cycle that reviews past Claude Code sessions and proposes validated updates to CLAUDE.md and skills.
$ npx skills add microsoft/SkillOpt --skill skillopt-sleep -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install microsoft/SkillOpt 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/microsoft/SkillOpt.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/claude-code/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/microsoft/SkillOpt/tree/main/plugins/claude-code/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/microsoft/SkillOpt/tree/main/plugins/claude-code/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 microsoft/SkillOpt --skill skillopt-sleep -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install microsoft/SkillOpt skillopt-sleep --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/SkillOpt.git skills-src && mkdir -p .agents/skills && cp -r skills-src/plugins/claude-code/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/microsoft/SkillOpt/tree/main/plugins/claude-code/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 microsoft/SkillOpt --skill skillopt-sleep -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install microsoft/SkillOpt skillopt-sleep --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/SkillOpt.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/plugins/claude-code/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/microsoft/SkillOpt/tree/main/plugins/claude-code/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/microsoft/SkillOpt.git --path plugins/claude-code/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 microsoft/SkillOpt --skill skillopt-sleep -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install microsoft/SkillOpt skillopt-sleep --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/SkillOpt.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/plugins/claude-code/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/microsoft/SkillOpt/tree/main/plugins/claude-code/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 microsoft/SkillOpt 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 microsoft/SkillOpt --skill skillopt-sleep -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/microsoft/SkillOpt.git skills-src && mkdir -p .github/skills && cp -r skills-src/plugins/claude-code/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/microsoft/SkillOpt/tree/main/plugins/claude-code/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 microsoft/SkillOpt --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 microsoft/SkillOpt skillopt-sleep --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/SkillOpt.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/plugins/claude-code/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/microsoft/SkillOpt/tree/main/plugins/claude-code/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-sleepRuns an on-demand or nightly sleep cycle that reviews past Claude Code sessions and proposes validated updates to CLAUDE.md and skills.
The skill gives a local Claude agent a sleep cycle: it reviews real past Claude Code sessions, replays recurring tasks through a chosen backend and consolidates what it learns into memory (CLAUDE.md) and skills (SKILL.md). With the default validation gate on, it keeps only changes that improve a held-out score, and live files change only through explicit adoption or a requested --auto-adopt. No model weights are trained.
The cycle has six stages, starting with harvest, mine, replay, consolidate and stage. Harvest reads session logs under ~/.claude read-only into digests, mine turns them into recurring task records, replay re-runs those under the current skill and memory, consolidate proposes bounded edits and gates them on a held-out slice, and stage writes proposed_CLAUDE.md and proposed_SKILL.md plus report and manifest files into a staging folder in the project's .skillopt-sleep directory. The cycle can also be scheduled with cron.
6 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 343db22. 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.
No URLs in SKILL.md.
From 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 Cycle loads about 2.3k tokens when it runs. Until then it costs about 144 tokens; SKILL.md has 938 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 microsoft/SkillOpt at commit 343db22, republished under its MIT licence (© microsoft). 938 words, ~2,250 tokens.
.claude/skills/skillopt-sleep/SKILL.md (or your agent's skills folder).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:
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 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.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)mock (deterministic, no API spend) — good for trying the plumbing.--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 all harvests every Claude
project into the current run's configured targets."${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|handoff|azure_openai | mock | Backend (mock = no provider calls) |
--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 | derived | Cap harvested sessions; defaults to 3 × max tasks (120 with current defaults) |
--max-tasks N | 40 | Cap mined tasks |
--target-skill-path PATH | ~/.claude/skills/skillopt-sleep-learned/SKILL.md | 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 |
--preferences TEXT | empty | Add house rules to the optimizer's reflection prior |
--json | off | Machine-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.
~/.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.gate_no_regression — false by default. Set to true to reject a candidate when any validation task's configured gate score decreases.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:
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.
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.mock replay has no side effects.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.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.# 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-improvesSee the SkillOpt-Sleep documentation for recorded results, limitations, and the supported integration surface.
© microsoft, 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 plugins/claude-code/skills/skillopt-sleep of microsoft/SkillOpt.
Open the folder on GitHubat commit 343db22
SkillOpt Sleep Cycle 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 Cycle this skillmicrosoft/SkillOpt | 18k | — | ~2.3k | Automated safety check: Pass | MIT | |
| Neat-Freak Knowledge CloseoutKKKKhazix/khazix-skills | 21k | — | ~1.9k | Automated safety check: Pass | MIT | |
| CLAUDE.md Improveranthropics/claude-plugins-official | 37k | 5 repos | ~1.5k | Automated safety check: Pass | Apache-2.0 | |
| Self ImprovementCraftOS-dev/CraftBot | 392 | 5 repos | ~4.9k | Automated safety check: Pass | MIT | |
| Harness Engineering10xChengTu/harness-engineering | 102 | 1 repos | ~1k | Automated safety check: Pass | None | |
| Codebase Analyzerseverity1/claude-code-auto-memory | 159 | — | ~1.5k | Automated safety check: Pass | MIT |
KKKKhazix/khazix-skills
Brings project docs, agent rule files, authorized memory and leftover workspace files back in line with what the code and runtime actually do at the end of a work session.
anthropics/claude-plugins-official
Finds every CLAUDE.md file in a repository, scores each against quality criteria, shows a report, then makes targeted updates after you approve.
CraftOS-dev/CraftBot
Captures learnings, errors, and corrections to enable continuous improvement.
10xChengTu/harness-engineering
Set up and improve harness engineering (AGENTS.md, docs/, lint rules, eval systems, project-level prompt engineering) for AI-agent-friendly codebases.
severity1/claude-code-auto-memory
This skill should be used when the user asks to "initialize auto-memory", "create CLAUDE.md", "set up project memory", or runs the /auto-memory:init command.
GODGOD126/self-improving-for-codex
Build or maintain a Codex-native self-improving memory loop using global AGENTS.md, a persistent memories directory, and optional nightly refinement automation.
microsoft/SkillOpt
Runs a nightly or on-demand sleep cycle for a local Codex agent: review past sessions, replay recurring tasks and stage validated skill and memory edits for adoption.
microsoft/SkillOpt
Mines recurring tasks from recent local Cursor sessions, replays them to test bounded skill edits, and stages validated improvements to a project Cursor skill for review.
microsoft/SkillOpt
Runs a usage-driven self-improvement cycle for the dsh agent: harvest past sessions, mine recurring tasks, replay them and stage validated skill edits.
microsoft/SkillOpt
Reference-only OpenClaw adaptation of SkillOpt-Sleep. Use it to study or port the contributed DeepSeek wrapper, not as a ready-to-run installation.
Categories
Runs an on-demand or nightly sleep cycle that reviews past Claude Code sessions and proposes validated updates to CLAUDE.md and skills. md). With the default validation gate on, it keeps only changes that improve a held-out score, and live files change only through explicit adoption or a requested --auto-adopt.
SkillOpt Sleep Cycle fits situations like: having the agent learn your preferences from past sessions; scheduling a nightly self-improvement run; reviewing and adopting a staged proposal for CLAUDE.md or a skill.
Run `npx skills add microsoft/SkillOpt --skill skillopt-sleep -a claude-code`. Or copy the skill folder (plugins/claude-code/skills/skillopt-sleep in microsoft/SkillOpt) into .claude/skills/skillopt-sleep in your project. Claude Code loads it when a task matches its description.
Run `npx skills add microsoft/SkillOpt --skill skillopt-sleep -a codex`. Or copy the skill folder (plugins/claude-code/skills/skillopt-sleep in microsoft/SkillOpt) 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 microsoft/SkillOpt --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 Cycle needs the command-line tools its instructions call (python). Our summary lists: Past Claude Code session history under ~/.claude; The skillopt_sleep engine.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. 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 Cycle is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.3k tokens (SKILL.md is roughly 9k 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 Cycle: Neat-Freak Knowledge Closeout (KKKKhazix/khazix-skills, 21k stars), CLAUDE.md Improver (anthropics/claude-plugins-official, 37k stars), Self Improvement (CraftOS-dev/CraftBot, 392 stars) and Harness Engineering (10xChengTu/harness-engineering, 102 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
microsoft (a GitHub organization, an official publisher) maintains it in microsoft/SkillOpt, which has 18,087 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 6, 2026.
Source: microsoft/SkillOpt on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.