Official agent skill

SkillOpt-Sleep for Cursor

by microsoft in 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.

OfficialMITAuto-check passedAgent Workflows

Install SkillOpt-Sleep for Cursor

skills CLI
$ npx skills add microsoft/SkillOpt --skill skillopt-sleep -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install microsoft/SkillOpt skillopt-sleep --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/microsoft/SkillOpt.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/cursor/skills/skillopt-sleep .claude/skills/skillopt-sleep && rm -rf skills-src

Use ~/.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/

Facts

Skill name
skillopt-sleep
GitHub stars
18k
Token cost
~2.4k tokens
SKILL.md length
1,026 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

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.

  • Works in 3 steps: Source checkout on macOS/Linux → Source checkout on Windows → Installed engine on any platform
  • Having Cursor learn from recent local sessions into a reusable project skill
  • SKILL.md covers Cursor target, Choose the runner, Core workflow and Commands, plus 4 more sections
  • Calls bash

What it does

The engine reviews recent local Cursor session transcripts, mines recurring checkable task records, replays those tasks under the current skill and memory through a selected backend, reflects on failures to propose bounded edits, and with its default validation gate enabled, accepts a proposal only when it improves the held-out score; a normal run only stages the proposal for review, and nothing live changes until explicit adoption, since there is no model-weight training involved. The plugin has no session-end hook and no MCP server, so a cycle only runs when asked, and a recurring schedule is installed only on explicit request.

A fixed project-relative target, .cursor/skills/skillopt-sleep-learned/SKILL.md, must be passed via --target-skill-path on the harvest, dry-run and run commands, since without it the shared engine defaults to a Claude-managed skill location that is not the intended Cursor target; the same engine can also evolve the project's CLAUDE.md unless that is disabled in a separate config file. Three equivalent command paths run the engine, a Bash script on macOS or Linux, a PowerShell script on Windows, or an installed skillopt-sleep binary, and the skill insists on stopping rather than substituting a hand-written edit if none of them is available.

The seven-step workflow ends with staging accepted proposals under a timestamped folder and adopting them only after review, backing up the existing live target first.

When your agent uses it

  • Having Cursor learn from recent local sessions into a reusable project skill
  • Running an offline consolidation pass over recurring Cursor tasks
  • Reviewing and adopting a staged SkillOpt-Sleep skill proposal
  • Checking SkillOpt-Sleep's status or scheduling a recurring harvest

Example prompts

  • “Run a SkillOpt-Sleep harvest over my recent Cursor sessions and show me the dry run.”
  • “What's the current SkillOpt-Sleep status and the latest staged proposal?”
  • “Adopt the staged skill proposal after backing up the current one.”

Requirements

  • The skillopt-sleep engine installed, or a SkillOpt source checkout with SKILLOPT_SLEEP_REPO set
  • Local Cursor session transcripts

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Source checkout on macOS/Linux
  2. Source checkout on Windows
  3. Installed engine on any platform

What it can do on your machine

Read from SKILL.md and the folder at commit 343db22. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    Shell commands in SKILL.md call:

    • bash

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

SkillOpt-Sleep for Cursor loads about 2.4k tokens when it runs. Until then it costs about 97 tokens; SKILL.md has 1,026 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~97
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from microsoft/SkillOpt at commit 343db22, republished under its MIT licence (© microsoft). 1,026 words, ~2,428 tokens.

Download SKILL.mdSave it as .claude/skills/skillopt-sleep/SKILL.md (or your agent's skills folder).
name
skillopt-sleep
description
Use when the user wants Cursor to learn from recent local sessions, asks for an offline sleep or dream cycle, wants to consolidate recurring work into a Cursor skill, or requests SkillOpt-Sleep status, harvest, dry-run, run, scheduling, review, or adoption. Drives the validation-gated skillopt_sleep engine with Cursor transcripts and the optional Cursor Agent CLI backend.

SkillOpt-Sleep for Cursor

SkillOpt-Sleep reviews recent local Cursor sessions, mines recurring tasks, replays those tasks, and proposes bounded improvements to a project Cursor skill. With the default gate enabled, a proposal is accepted only when it improves the held-out score. A normal run stages the proposal for review; nothing live changes until explicit adoption. There is no model-weight training.

This plugin has no session-end hook and no MCP server. Run the cycle only when the user asks, or install a schedule only when the user explicitly requests one.

Cursor target

Always use this project-relative target for Cursor-visible learning:

text
.cursor/skills/skillopt-sleep-learned/SKILL.md

Pass it through --target-skill-path on harvest, dry-run, and run. Without an explicit target, the shared engine uses a Claude-managed skill under ~/.claude/skills, which is not the intended Cursor project skill.

The shared engine can also evolve project CLAUDE.md. If that secondary memory target is unwanted, set "evolve_memory": false in ~/.skillopt-sleep/config.json before running.

Choose the runner

Use one of these supported command paths consistently:

  1. Source checkout on macOS/Linux: bash "$SKILLOPT_SLEEP_REPO/plugins/run-sleep.sh" <action> ...
  2. Source checkout on Windows: powershell -File "$env:SKILLOPT_SLEEP_REPO\plugins\run-sleep.ps1" <action> ...
  3. Installed engine on any platform: skillopt-sleep <action> ...

If SKILLOPT_SLEEP_REPO is not set and skillopt-sleep is unavailable, stop and explain that the engine must be installed or a SkillOpt checkout must be selected. Do not substitute a hand-written edit for the engine workflow.

Core workflow

  1. Harvest local Cursor JSONL transcripts read-only.
  2. Mine recurring, checkable task records from session digests.
  3. Replay tasks under the current skill and memory through the selected backend.
  4. Reflect on failures and propose bounded edits.
  5. Gate the candidate on held-out real tasks.
  6. Stage accepted proposals under <project>/.skillopt-sleep/staging/<timestamp>/.
  7. Adopt only after review, backing up existing live targets first.

Commands

Use the installed-command form below, or replace skillopt-sleep with the platform-specific source runner described above.

bash
TARGET_SKILL=.cursor/skills/skillopt-sleep-learned/SKILL.md

# Inspect current state and the latest staged proposal.
skillopt-sleep status --project "$(pwd)"

# Inspect mined tasks without provider spend.
skillopt-sleep harvest --project "$(pwd)" --source cursor \
  --target-skill-path "$TARGET_SKILL" --max-sessions 5 --max-tasks 3

# First smoke check: deterministic and no provider calls.
skillopt-sleep dry-run --project "$(pwd)" --source cursor --backend mock \
  --target-skill-path "$TARGET_SKILL" --max-sessions 5 --max-tasks 3 --json

# Model-driven optimization through the authenticated Cursor Agent CLI.
skillopt-sleep run --project "$(pwd)" --source cursor --backend cursor \
  --target-skill-path "$TARGET_SKILL" \
  --max-sessions 5 --max-tasks 3 --progress

# Inspect selections, then apply the reviewed managed proposal.
skillopt-sleep status --project "$(pwd)"
skillopt-sleep adopt --project "$(pwd)" --legacy

For fan-out proposals, use repeatable --skill NAME or --all-skills after review. Bare adopt deliberately refuses a night containing fan-out rows.

Actions are status, harvest, dry-run, run, adopt, schedule, and unschedule.

  • Default backend is mock, which is deterministic and makes no provider calls.
  • --backend cursor uses the user's authenticated Cursor Agent CLI budget for model-driven mining, replay, judging, and reflection.
  • --source cursor reads ~/.cursor/projects/<workspace>/agent-transcripts/*/*.jsonl.
  • --cursor-home PATH overrides the Cursor home used for harvesting.
  • --scope invoked selects the current workspace; --scope all includes every Cursor workspace.
  • --cursor-path PATH or SKILLOPT_SLEEP_CURSOR_PATH selects a non-default cursor-agent executable.
  • --model NAME or SKILLOPT_SLEEP_CURSOR_MODEL overrides the Cursor model.
  • Check model identifiers with cursor-agent --list-models; when cost matters, verify the billed variant in Cursor's usage reporting.
  • Keep live runs bounded with --max-sessions, --max-tasks, and --progress.
  • A held-out gain is evidence for that run, not a promise of general improvement.

The first harvest uses a 72-hour lookback. Use --lookback-hours N for a wider initial window or --lookback-hours 0 for all available history. A stateful run, including a no-task run, records a harvest checkpoint; later runs use the checkpoint rather than the initial lookback. Inspect counts with harvest or dry-run before the first real run because those actions do not advance state.

Available backends are:

  • mock - deterministic, with no provider calls (default);
  • cursor - the authenticated Cursor Agent CLI;
  • claude - the authenticated Claude CLI;
  • codex - the authenticated Codex CLI;
  • copilot - the authenticated GitHub Copilot CLI;
  • handoff - prompt/answer files for an interactive agent session;
  • azure_openai - the configured Azure OpenAI endpoint.

SkillOpt reads the target skill and inserts its text into replay prompts; it does not invoke the file as a native Cursor skill. Ordinary Cursor backend calls run in a new empty temporary workspace in read-only Ask mode. File reads, file writes, and MCP tools are denied. --project controls harvesting, target files, state, and staging; it is not the Cursor Agent execution workspace.

Cursor tool-aware replay is temporarily disabled pending live Cursor permission-boundary validation. A task containing a tool_called check fails nonzero before Agent mode starts. The failed replay does not add a cache entry, stage, adopt, persist state, or advance the harvest checkpoint. Use another backend for those tasks. Do not claim that repository- or tool-dependent behavior was validated. The current engine does not implement a fresh-worktree replay for Cursor.

A real-backend dry-run still makes provider calls; it only suppresses staging. Session and task limits are workload bounds, not hard limits on calls, tokens, time, or money. Start with small limits.

Show full SKILL.md (315 more words)Show less

Reviewable data path

Cursor harvesting retains user/assistant text, tool names, and explicit turn errors while excluding raw tool arguments, tool outputs, and non-message records. Known secret-shaped strings are redacted, but pattern-based redaction cannot guarantee that a transcript is safe to send to a provider.

For sensitive sessions, export tasks before any real-backend replay:

bash
TARGET_SKILL=.cursor/skills/skillopt-sleep-learned/SKILL.md
skillopt-sleep harvest --project "$(pwd)" --source cursor \
  --target-skill-path "$TARGET_SKILL" \
  --max-sessions 5 --max-tasks 3 --output reviewed-tasks.json

Inspect and redact the file, then set its top-level "reviewed" field to true. Only then run:

bash
skillopt-sleep dry-run --project "$(pwd)" --backend cursor \
  --tasks-file reviewed-tasks.json --progress --json

Real backends reject task files that remain unreviewed. Never include raw transcripts, credentials, secrets, or sensitive task content in messages, commits, or generated summaries.

gate_no_regression is a config-only safeguard in ~/.skillopt-sleep/config.json. It defaults to false; set it to true to reject a candidate when any validation task's configured gate score decreases.

Scheduling

Scheduling is opt-in. The scheduler persists project, backend, time, and the optional auto-adopt flag, but not --source, Cursor path/home/model overrides, or --target-skill-path. Before scheduling a Cursor cycle, set at least these values in ~/.skillopt-sleep/config.json:

json
{
  "transcript_source": "cursor",
  "target_skill_path": ".cursor/skills/skillopt-sleep-learned/SKILL.md",
  "backend": "cursor"
}

Then run:

bash
skillopt-sleep schedule --project "$(pwd)" --backend cursor --hour 3 --minute 17
skillopt-sleep unschedule --project "$(pwd)"

The scheduler uses cron on Unix and Task Scheduler on Windows. Scheduled runs stage proposals by default. Use --auto-adopt only when the user has explicitly requested unattended adoption.

Report results

For dry-run and run, report:

  • session and task counts;
  • held-out baseline and candidate scores;
  • gate action and accepted/rejected edit counts;
  • exact proposed edits;
  • staging directory, when one was created.

Read staged report.md before summarizing a run. Offer adoption only after the user reviews an accepted proposal that is still staged. Never claim broad improvement from one run.

Hard rules

  • Harvest is read-only. Never edit Cursor transcript files.
  • Never hand-edit the target skill or CLAUDE.md as a substitute for adoption.
  • Do not run a real backend on sensitive content without confirming its data boundary or using the reviewed-task workflow.
  • Do not add a session-end hook or imply that installing this plugin schedules anything.
  • Show validation evidence before recommending adoption.
  • Treat generated edits as proposals, not as source of truth.

© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/cursor/skills/skillopt-sleep of microsoft/SkillOpt.

Open the folder on GitHubat commit 343db22

Compare with similar skills

SkillOpt-Sleep for Cursor 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.

SkillOpt-Sleep for Cursor compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
SkillOpt-Sleep for Cursor this skillmicrosoft/SkillOpt18k—~2.4kAutomated safety check: PassMIT
Watchmen Setupfirstbatchxyz/watchmen297—~1.1kAutomated safety check: NotesMIT
Watchmen Setupfirstbatchxyz/watchmen297—~1.2kAutomated safety check: NotesMIT
Loopany Reflectsuperdesigndev/loopany140—~1.4kAutomated safety check: PassNone
OmniRoute Plugins, Skills and Memory CLIdiegosouzapw/OmniRoute74k—~1kAutomated safety check: PassMIT
Self-Refinement from CorrectionsdavidYichengWei/agentic-engineering-framework158—~575Automated safety check: PassMIT

Similar skills

  • Watchmen Setup

    firstbatchxyz/watchmen

    Walks through installing watchmen, running its init wizard, wiring the plugin into Codex or Claude Code and checking the result with doctor.

    297 GitHub stars~1.1k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check: notes
  • Watchmen Setup

    firstbatchxyz/watchmen

    Sets up watchmen on the current machine: installs the CLI, hands off the init wizard, wires the plugin and statusline into Claude Code and Codex, and verifies with doctor.

    297 GitHub stars~1.2k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check: notes
  • Loopany Reflect

    superdesigndev/loopany

    Runs a self-improvement loop for loopany: reads recent task outcomes and dismissed signals, finds patterns, writes learnings and skill proposals, and applies accepted ones.

    140 GitHub stars~1.4k tokensUpdated 4 mo ago
    Agent WorkflowsAuto-check passed
  • Command reference for the omniroute CLI's memory, plugin, marketplace and skills commands: search and manage stored memory, install and scaffold plugins, and find skill packages.

    74k GitHub stars~1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Self-Refinement from Corrections

    davidYichengWei/agentic-engineering-framework

    Turns mistakes you correct into proposed updates to persistent Rules and Skills so the same error does not recur in later sessions, triggered automatically or with /reflect.

    158 GitHub stars~575 tokensUpdated 6 mo ago
    Agent WorkflowsAuto-check passed
  • Learn From Session

    tigerless-labs/autoharness

    Use when the user says /learn or asks to save this lesson.

    9.2k GitHub stars~280 tokensUpdated yesterday
    Agent WorkflowsAuto-check passed

More from microsoft/SkillOpt

  • SkillOpt Sleep Cycle

    microsoft/SkillOpt

    Official

    Runs an on-demand or nightly sleep cycle that reviews past Claude Code sessions and proposes validated updates to CLAUDE.md and skills.

    18k GitHub stars~2.3k tokensUpdated today
    Auto-check passed
  • Official

    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.

    18k GitHub stars~2.3k tokensUpdated today
    Auto-check passed
  • SkillOpt Sleep Cycle

    microsoft/SkillOpt

    Official

    Runs a usage-driven self-improvement cycle for the dsh agent: harvest past sessions, mine recurring tasks, replay them and stage validated skill edits.

    18k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Official

    Reference-only OpenClaw adaptation of SkillOpt-Sleep. Use it to study or port the contributed DeepSeek wrapper, not as a ready-to-run installation.

    18k GitHub stars~1.3k tokensUpdated today
    Auto-check passed

Categories

Questions about SkillOpt-Sleep for Cursor

What does SkillOpt-Sleep for Cursor do?

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. The engine reviews recent local Cursor session transcripts, mines recurring checkable task records, replays those tasks under the current skill and memory through a selected backend, reflects on failures to propose bounded edits, and with its default validation gate enabled, accepts a proposal only when it improves the held-out score; a normal run only stages the proposal for review, and nothing live changes until explicit adoption, since there is no model-weight training involved. The plugin has no session-end hook and no MCP server, so a cycle only runs when asked, and a recurring schedule is installed only on explicit request.

When should I use SkillOpt-Sleep for Cursor?

SkillOpt-Sleep for Cursor fits situations like: having Cursor learn from recent local sessions into a reusable project skill; running an offline consolidation pass over recurring Cursor tasks; reviewing and adopting a staged SkillOpt-Sleep skill proposal; checking SkillOpt-Sleep's status or scheduling a recurring harvest.

How do I install SkillOpt-Sleep for Cursor in Claude Code?

Run `npx skills add microsoft/SkillOpt --skill skillopt-sleep -a claude-code`. Or copy the skill folder (plugins/cursor/skills/skillopt-sleep in microsoft/SkillOpt) into .claude/skills/skillopt-sleep in your project. Claude Code loads it when a task matches its description.

How do I install SkillOpt-Sleep for Cursor in Codex?

Run `npx skills add microsoft/SkillOpt --skill skillopt-sleep -a codex`. Or copy the skill folder (plugins/cursor/skills/skillopt-sleep in microsoft/SkillOpt) into .agents/skills/skillopt-sleep in your project. Codex loads it when a task matches its description.

Can I use SkillOpt-Sleep for Cursor in Cursor, Gemini CLI or GitHub Copilot?

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.

What does SkillOpt-Sleep for Cursor need to run?

Going by SKILL.md and its folder, SkillOpt-Sleep for Cursor needs the command-line tools its instructions call (bash). Our summary lists: The skillopt-sleep engine installed, or a SkillOpt source checkout with SKILLOPT_SLEEP_REPO set; Local Cursor session transcripts.

Does SkillOpt-Sleep for Cursor access the network?

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.

Is SkillOpt-Sleep for Cursor safe to install?

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.

What licence does SkillOpt-Sleep for Cursor use?

SkillOpt-Sleep for Cursor is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does SkillOpt-Sleep for Cursor use?

About 2.4k tokens (SKILL.md is roughly 9.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to SkillOpt-Sleep for Cursor?

Skills that share tags, products or a category with SkillOpt-Sleep for Cursor: Watchmen Setup (firstbatchxyz/watchmen, 297 stars), Watchmen Setup (firstbatchxyz/watchmen, 297 stars), Loopany Reflect (superdesigndev/loopany, 140 stars) and OmniRoute Plugins, Skills and Memory CLI (diegosouzapw/OmniRoute, 74k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains SkillOpt-Sleep for Cursor?

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.