SkillOpt-Sleep: nightly self-improvement from your past sessions
microsoft/SkillOpt
Your assistant gets a "sleep cycle". On request or every night, it rereads your recent chats with it, finds tasks you repeat, retries them and proposes small edits to its own instruction files. An edit is kept only if it scores better on test tasks it held back, and nothing changes until you approve it.
Pack description by its author: “Your assistant gets a "sleep cycle". On request or every night, it rereads your recent chats with it, finds tasks you repeat, retries them and proposes small edits to its own instruction files. An edit is kept only if it scores better on test tasks it held back, and nothing changes until you approve it.”
DevOps, cloud and securityCommands you run when neededGives your assistant new abilities with scripts
1. Changes your files
None of its skills edits your files.
github.com/microsoft/SkillOpt/blob/e2edfa9/2. Runs code on your machine
End of every Claude Code session: An async hook appends one line (time and folder) to ~/.skillopt-sleep/session-end.log. No optimizer, no network. /skillopt-sleep run, dry-run, harvest: Reads ~/.claude session files (read only), runs the Python engine; run writes reports and proposals to <project>/.skillopt-sleep/staging/<timestamp>/ and state to ~/.skillopt-sleep/.
github.com/microsoft/SkillOpt/blob/e2edfa9/3. Sends data
Install from github.com/microsoft/SkillOpt only. The plugin runs a small hook at every session end and Python code on demand; real backends send excerpts of your past sessions to a model provider, and adopt writes to ~/.claude/skills. The OpenClaw folder is a contributed reference with machine-specific paths: the repo says not to run it unchanged.
github.com/microsoft/SkillOpt/blob/e2edfa9/4. Commercial use
MIT: keep the copyright and license notice
github.com/microsoft/SkillOpt/blob/e2edfa9/Checked against the pack's files at commit e2edfa9, on Nov 2, 2026. Tap a verdict to see its source.How we checkedReport an error
The pack has changed since AgentGid checked it on Nov 2, 2026. Some details may be out of date.
Good for you if
- You use Claude Code, Codex, Cursor, GitHub Copilot or Devin every day on similar tasks
- You want your assistant to learn your habits and preferences across sessions
- You are fine with installing Python 3.10 and running a few terminal commands
Probably not for you if
- Your chats contain secrets you cannot send to a model provider: the real modes send excerpts of them out
- You want a ready skill that changes the assistant at once; this one only proposes changes after a run
What you'll notice
- New commands: /skillopt-sleep (status, dry-run, run, adopt, harvest, schedule) and /skillopt-sleep-handoff
- A report after each run: score before and after, keep or reject, and the exact edits proposed
- A new folder .skillopt-sleep/ in your project with proposals, reports and backups
- If you schedule it, a nightly job on your computer (cron on Mac and Linux, Scheduled Task on Windows)
What you need
- Claude Code, Codex, Cursor, GitHub Copilot, Devin, DeepSeek Harness
- Mixed, MIT license
- Clone the repository, then add the plugin in Claude Code (or run the Codex or Cursor install script)
- Free with the default mock mode, which makes no model calls. Real improvement needs a model: an authenticated claude, codex, cursor-agent or copilot command line tool, or Azure OpenAI keys, on your own budget.
Words on this page
- Skill
- A set of written instructions your AI assistant follows. Installing one is like giving it a playbook.
- Plugin
- A package your assistant installs that can bring skills, commands and hooks together.
- Hook
- A small program the assistant runs by itself at set moments, for example when a session starts.
- API
- A way for programs to talk to a service, usually with a key.
- CLI
- A program you run by typing commands in a terminal.
- Slash command
- A command you type in the assistant's chat, starting with /.
| Repository | microsoft/SkillOpt · website |
|---|---|
| GitHub stars | 19,179 |
| Skills | 1 (2 SKILL.md in the repo) |
| Category | DevOps, cloud and security |
| License | MIT |
| Last updated | Nov 21, 2026 · card checked Nov 2, 2026 at commit e2edfa9 |
| Install counts | microsoft/SkillOpt on skills.sh, Vercel's skills directory, which shows installs and security audits per skill |
microsoft/SkillOpt popularity over time
What SkillOpt-Sleep does
Before writing anything, the assistant takes the first option that fully works:
- Harvest: read your past sessions from ~/.claude (read only)
- Mine: turn them into a list of recurring tasks
- Replay: run those tasks again with the current skill and memory, and score the answers
- Consolidate: look at failures, propose a few small add / delete / replace edits, keep them only if a held-out score goes up
- Stage: write the proposal and a report into <project>/.skillopt-sleep/staging/<timestamp>/; nothing live changes
- Adopt: on your command, copy the staged files over the live ones, with a backup first
Never cut, per the skill: the held-out check (on by default); a backup before every adopt; your live CLAUDE.md and skill files stay untouched until adopt.
| Level | Behaviour |
|---|---|
| mock | Default: fixed rule-based answers, no model calls, no cost; tests the plumbing only |
| real backend | claude, codex, cursor, copilot, pi, opencode or azure_openai: real model calls on your budget |
| handoff | No model subprocess: the current session answers the prompts through fresh subagents |
From the pack's SKILL.md files, summarised by AgentGid.
The 2 skills, explained
skillopt-sleep
Runs the sleep cycle and shows what your assistant would learn; edits its instruction files only when you adopt
You give
- Your project folder (the current one by default)
- Which model does the work: mock (free), claude, codex and others
- Optional house rules, for example "Prefer pytest"
- How far back to look (72 hours by default) and how many tasks (40 by default)
You get
- A list of recurring tasks found in your sessions
- Held-out score before and after
- The gate decision: accept or reject
- The exact edits proposed to CLAUDE.md and the learned skill
- Where the proposal is staged, and a backup on adopt
skillopt-sleep-handoff
The same cycle, but the current chat answers the model questions, so no separate key is needed
You give
- run or dry-run
- Optional house rules
You get
- Up to 8 rounds of prompts answered in fresh, isolated helpers
- The same report: score before and after, decision, proposed edits
See it in action
The skill defines what its answer looks like. Its own example:
harvest done: sessions=120 (skipped: 297 repeated-template sessions, 2 past the session cap)
The skill defines what its answer looks like. Its own example:
held-out score: baseline → candidate; the gate decision (accept/reject) and the exact edits; where the proposal is staged
When to reach for it
| You want | Use |
|---|---|
| See what has run and the latest proposal | /skillopt-sleep status |
| A preview of what it would learn without staging anything | /skillopt-sleep dry-run |
| A full cycle that stages a proposal for review | /skillopt-sleep run (add --backend claude or codex for real model work) |
| To apply a reviewed proposal | /skillopt-sleep adopt --legacy, or adopt --skill NAME / --all-skills |
| To run it every night | /skillopt-sleep schedule --hour 3 --minute 17 |
| Real model work without a separate key | /skillopt-sleep-handoff run |
| To steer what it learns | --preferences "Prefer pytest. Keep commit subjects imperative and concise." |
Skills in microsoft/SkillOpt
| Skill | In plain words | Changes files? | What it does (author) |
|---|---|---|---|
skillopt-sleep/skillopt-sleep [run | dry-run | status | adopt | harvest | schedule | unschedule], or plain language ("run the sleep cycle") |
Runs the sleep cycle and shows what your assistant would learn; edits its instruction files only when you adopt | No | 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…npx skills add microsoft/SkillOpt --skill skillopt-sleep |
The author's descriptions come from each skill's SKILL.md; the plain-words column is AgentGid's.
Good to know before you install
- This is mainly a research framework from Microsoft for training skill files on benchmarks; the installable part for assistants is SkillOpt-Sleep in the plugins folder.
- Real modes send shortened excerpts of your past chats to the chosen model provider, and secrets are not guaranteed to be removed. Use mock, or export the tasks, review them and mark them reviewed first.
- Adopt writes outside the project: the learned skill goes to ~/.claude/skills/skillopt-sleep-learned/SKILL.md by default, plus your project CLAUDE.md.
- The Claude Code plugin needs the Python engine too: a clone of the repository or pip install skillopt. PyPI 0.2.0 lacks handoff mode and some newer options.
- The token budget per night (400,000 by default) is not a hard cap: a started step finishes.
- --auto-adopt and gate_mode off remove the safety steps: changes go live, or every edit is accepted.
Before you start
Works in
- Claude Code: plugin
- Codex: skills folder
- Cursor: plugin
- GitHub Copilot: MCP server
- Devin: MCP server
- DeepSeek Harness: plugin
You will need
- Python 3.10+: The engine is a Python package
- An installed, logged-in agent command line tool (claude, codex, cursor-agent, copilot or pi): Only for real backends
- Azure OpenAI or OpenAI-compatible endpoint and key: Only for --backend azure_openai
Steps only you can do
- Install and log in to the agent command line tool you pick as the backend (claude, codex, cursor-agent, copilot or pi) (plugins/README.md (Install))
Then: The assistant runs the cycle with --backend set to that tool - For sensitive chats, open the exported task file, remove anything private and set "reviewed": true (plugins/README.md (Data boundary))
Then: The assistant replays the reviewed file with --tasks-file and a real backend - Read the report (score before and after, proposed edits) and decide what to adopt (plugins/claude-code/commands/skillopt-sleep.md)
Then: The assistant runs adopt with the selection you chose (--legacy, --skill NAME or --all-skills) - For --backend azure_openai, put your own endpoint and key in AZURE_OPENAI_* environment variables (.env.example)
Then: The assistant runs the cycle against your Azure or OpenAI-compatible endpoint
Mistakes to avoid
Run it in the default mock mode and expect real improvement
Use mock only to check the setup; pick a real backend (claude, codex and others) or handoff for actual learning
Mock gives fixed rule-based answers and makes no model callsInstall the engine with pip install skillopt and use handoff mode, --preferences or subset adoption
Use a source checkout of the repository from main, or wait for the next release
PyPI 0.2.0 lacks these newer featuresIn handoff mode, answer the pending prompts in the same chat that started the cycle
Answer each prompt in a fresh, isolated context (the /skillopt-sleep-handoff command does this with subagents)
A context that has seen the held-out answers makes the score look better than it isSchedule a nightly run with --source, --model or --target-skill-path on the command line and expect them to stick
Put transcript_source, model and target_skill_path in ~/.skillopt-sleep/config.json before scheduling
The scheduled command stores only the project, backend, time and auto-adopt settingChoose --backend azure_openai without setting AZURE_OPENAI_ENDPOINT
Set AZURE_OPENAI_ENDPOINT to your own endpoint first
Without it the engine falls back to a built-in table of Azure endpoints in its code
Which one to pick
| If you need | Pick |
|---|---|
| You want gated, measured edits to CLAUDE.md and a skill from replaying your past sessions, on demand or nightly | This pack |
| You want corrections and preferences you give during work captured and synced to CLAUDE.md and AGENTS.md | BayramAnnakov/claude-reflect |
| You want one skill evaluated, improved, tested, then kept or reverted in a loop | alchaincyf/darwin-skill |
| You want to evaluate skills and evolve them with evidence, not learn from your own chats | alibaba/skill-up |
Works well with
- claude-code: The main plugin with /skillopt-sleep commands and a session-end hook is built for Claude Code
- openai-codex: Codex gets the same engine as a user-level skill and can be the backend
- cursor: A Cursor plugin, transcript source and cursor-agent backend are included
- uv: The runner's fallback suggests uv tool install skillopt when no source checkout is found
May I use it like this?
| Use | Answer | Condition |
|---|---|---|
| In a commercial app | Yes | MIT: keep the copyright and license notice |
| Passing the files on | Yes | MIT: include the copyright and permission notice in copies |
| Work for clients | Yes | MIT allows use in work for others |
| Shipped inside your app | Yes | MIT; the Python package declares the same license |
What leaves your machine
- Shortened excerpts of your past sessions and the tasks mined from them (mining, replay, judging and reflection prompts) → The provider behind the backend you pick (for example Anthropic through the claude tool, OpenAI through codex, Cursor and its model provider), Every run, dry-run or scheduled night with a real backend. Opt out: Use the default mock backend, or review and redact a task file first
- The same prompts, sent through the Cursor command line tool → Cursor and the model provider Cursor selects, Only with --backend cursor. Opt out: Use another backend or mock
- The same prompts, sent to an Azure OpenAI or OpenAI-compatible endpoint → AZURE_OPENAI_ENDPOINT, or a built-in Azure endpoint if it is not set, Only with --backend azure_openai. Opt out: Do not select azure_openai
- Pending prompts answered by fresh helpers in your current chat → The model provider of your current Claude Code session, Only with /skillopt-sleep-handoff. Opt out: Use mock, or stop when a batch looks private
Install SkillOpt-Sleep
Official commands from the repository
git clone https://github.com/microsoft/SkillOpt.git cd SkillOpt /plugin marketplace add ./plugins/claude-code /plugin install skillopt-sleep@skillopt-sleep /skillopt-sleep status
Needs Python 3.10+. If no engine is installed, the runner installs nothing itself: it prints `uv tool install skillopt` or `pip install skillopt` as a hint.
Remove: /plugin remove skillopt-sleep; also /skillopt-sleep unschedule if you scheduled it
bash plugins/codex/install.sh
Copies the skill to ~/.agents/skills/skillopt-sleep/ and renames an old ~/.codex/prompts/sleep.md to a .bak file. Then set SKILLOPT_SLEEP_REPO in your shell profile.
Remove: delete ~/.agents/skills/skillopt-sleep/
bash plugins/cursor/install.sh powershell -File plugins/cursor/install.ps1 (Windows)
Copies the plugin into ~/.cursor/plugins/local/skillopt-sleep; restart Cursor.
Remove: delete ~/.cursor/plugins/local/skillopt-sleep
Register plugins/copilot/mcp_server.py or plugins/devin/mcp_server.py using the example MCP config, then ask it to run sleep_status.
pip install skillopt python -m skillopt_sleep run --project "$(pwd)" --scope invoked --backend mock
Or with the open-source skills CLI: npx skills add microsoft/SkillOpt. Skills are instructions your agent follows: read them before installing.
What it installs and runs on your machine
Read in the code at commit e2edfa9, Nov 2, 2026
| When | What happens |
|---|---|
| End of every Claude Code session | An async hook appends one line (time and folder) to ~/.skillopt-sleep/session-end.log. No optimizer, no network. |
| /skillopt-sleep run, dry-run, harvest | Reads ~/.claude session files (read only), runs the Python engine; run writes reports and proposals to <project>/.skillopt-sleep/staging/<timestamp>/ and state to ~/.skillopt-sleep/. |
| Real backend (opt-in) | Calls the chosen tool as a subprocess, e.g. `claude -p` with tools and slash commands disabled in an empty temp folder; it uses your login or ANTHROPIC_API_KEY. azure_openai uses AZURE_OPENAI_* keys. Transcript excerpts go to that provider. |
| /skillopt-sleep adopt | Copies staged files over your project CLAUDE.md and the target skill (default under ~/.claude/skills/), after a backup in the staging folder's backup/. |
| /skillopt-sleep schedule | Adds a managed crontab entry (Unix) or Scheduled Task (Windows) that runs the cycle nightly; unschedule removes it. |
| Codex / Cursor install | Shell or PowerShell scripts copy skill files into ~/.agents/skills or ~/.cursor/plugins/local. |
The author's numbers, as reported
AgentGid did not run these tests
- Best or tied-best on all 52 evaluated (model, benchmark, harness) cells (Six benchmarks, seven target models, three harnesses; see the paper). Source
- On GPT-5.5, average no-skill accuracy up +23.5 points in direct chat, +24.8 in Codex, +19.1 in Claude Code. Source
- SkillOpt-Sleep on gbrain-evals brief-writer: held-out 0.00 → 1.00 with Claude Haiku 4.5 (1 night) and Codex (2 nights) (A deliberately deficient seed skill, local rule judge, small replay and holdout limits). Source
- Without the gate, GPT-5.4-nano on SearchQA fell from 0.554 to 0.026 over 5 nights; with the gate it stayed at 0.570 (Optimizer GPT-5.5, single seed, gate off vs on). Source
Settings
~/.skillopt-sleep/config.json: preferences, gate_mode, gate_metric, gate_no_regression, dream_rollouts, recall_k, evolve_memory, evolve_skill, max_tokens_per_night, target_skill_pathSKILLOPT_SLEEP_REPO: path to a SkillOpt clone so the runner finds the engineSKILLOPT_SLEEP_PYTHON: explicit Python interpreter for the runnerSKILLOPT_SLEEP_AGENT_MARKERS: drop sessions whose first prompt contains one of these markersSKILLOPT_SLEEP_NEG_FEEDBACK / SKILLOPT_SLEEP_POS_FEEDBACK: extra phrases that count as rejecting or approving an answerSKILLOPT_SLEEP_REPEAT_MIN_SESSIONS: drop repeated single-turn template sessions (default 0, off)ANTHROPIC_API_KEY: optional auth for the claude backendAZURE_OPENAI_ENDPOINT / AZURE_OPENAI_API_KEY / AZURE_OPENAI_AUTH_MODE: for --backend azure_openai
Quick answers
- Is it free?
- The code is MIT licensed and mock mode makes no model calls. Real improvement uses a model on your own budget or subscription.
- Will it change my files on its own?
- No. Runs only stage proposals; live files change on adopt, or with --auto-adopt that you switch on yourself.
- Does it send my chats anywhere?
- Not in mock or handoff mode. A real backend sends shortened excerpts of past sessions and mined tasks to the chosen provider, without a guarantee that secrets are removed.
- Can I check what would be sent first?
- Yes. Export the tasks with harvest --output, review and redact the file, set "reviewed": true and pass it with --tasks-file; real backends refuse unreviewed files.
- How do I stop the nightly run?
- /skillopt-sleep unschedule, or unschedule --all for every managed entry.
Checked by AgentGid on Nov 2, 2026 against commit e2edfa9 of the pack's own files. Related: alchaincyf/darwin-skill. agent.md for AI agents · Report a mistake
More devops, cloud and security skill packs
| # | Install | |||||
|---|---|---|---|---|---|---|
| 1 |
ruvnet/RuView
Checked
A guide for your AI assistant to the RuView project. RuView uses WiFi signals and cheap ESP32 boards to sense people in a room: presence, breathing, heart rate and body pose. Your assistant walks you through the demo, flashing and setting up the boards, running the sensing apps, training models and checking a build. |
105K | +6,415 | 53 | ||
| 2 |
Becomes a careful security reviewer for your code. Ask a security question and it answers with the relevant checks. Ask for a full audit and it runs a team of helper agents in six steps. A fresh agent tries to disprove each finding, and the report gives proof and the smallest fix. |
76.8K | +43.1K | 1 | ||
| 3 |
A library of 818 security playbooks for your AI assistant: investigating alerts, analysing malware, checking cloud setups, hunting for intruders, and also attack techniques used in authorised testing. Your assistant picks the playbook that matches your question and follows its steps. Almost every playbook comes with a small Python helper script the assistant can run. |
36.5K | +1,777 | 818 | ||
| 4 |
Nine skills from Vercel for your AI coding assistant. Some are rule books for React, Next.js and React Native apps. Two review your pages or your docs against Vercel's guidelines. Three put your site on Vercel or check its costs and speed. |
34.7K | +1,684 | 9 | ||
| 5 |
Before you add a new skill to your AI assistant, it checks whether the skill is safe. A scanner looks for known risky patterns, then your assistant reads the source itself. You get one of three verdicts: approve, caution or reject, with the evidence behind it. |
27.2K | +5,857 | 30 | ||
| 6 |
pascalorg/editor
Checked
Two playbooks that let your AI assistant work in Pascal, a free 3D building editor. It can make and edit a room or a house model, check it, save it and give you the link to open it. It can also tell you whether a sofa, bed or table fits in a measured room, and it says plainly what it did not check. |
25.7K | +675 | 5 |
No pack matches.