SkillOpt Sleep for Claude Code drives the skillopt_sleep engine from a skill. It harvests past Claude Code sessions, mines recurring tasks, replays them through a chosen backend and proposes small edits to CLAUDE.md and a managed SKILL.md.
With the default gate on, an edit is kept only when it improves a held-out score. Proposals land in a staging folder, and live files change only when you adopt them or ask for auto-adopt.
What You Get
- A six-stage cycle: harvest, mine, replay, consolidate, stage and adopt
- Staged proposals (proposed CLAUDE.md, proposed SKILL.md, report and manifest files) that leave live files alone until adopted
- Commands for status, dry-run, run, adopt, schedule and unschedule
- A default mock backend that spends no API budget, plus claude and codex backends for real optimization runs
Common Use Cases
- Let Claude Code pick up your recurring preferences from past sessions and write them into CLAUDE.md
- Run a nightly review of the last 72 hours of work and look at the staged report in the morning
- Preview a cycle with the mock backend before spending any budget
- Try the bundled synthetic demo that shows a held-out score rising and the gate rejecting a regression
What Makes It Unique
Edits are bounded add, delete and replace operations, and each one has to improve a held-out score before it is proposed. The skill also tells the agent to show the baseline and candidate scores and the exact edits before suggesting adoption, and forbids hand-editing CLAUDE.md or SKILL.md around the engine’s backup-first adopt step.
Under The Hood
The skill is prose that tells the agent to run a bundled shell script (sleep.sh) with a subcommand, which starts the Python skillopt_sleep engine. Harvesting reads session files under the Claude home folder and the history file, read-only. A real backend (claude, codex, copilot, azure_openai) sends truncated transcript excerpts and derived tasks to that provider, and the skill warns that secret redaction is pattern-based; for sensitive sessions it describes exporting tasks, reviewing them and replaying from a reviewed file. The run writes staging files inside the project folder. Adopt copies the staged files over CLAUDE.md and the managed SKILL.md after making a backup. The schedule command installs a nightly cron entry.