Agent skill · product strategy · alirezarezvani
skillopt-sleep
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 skillopt_sleep engine: harvest past sessions → mine recurring tasks → replay offline → consolidate validated CLAUDE.md and SKILL.md behind a held-out gate.
Why this skill is useful
Adds a comprehensive offline self-improvement cycle with executable scripts that enhance the agent's memory and skills based on user interactions.
What it needs
Requires claude installed locally. About 4k tokens when loaded. Last updated 2026-08-05. 23,939 stars on the source repository.
What this skill does
SkillOpt-Sleep: offline self-evolution for a local Claude agent 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: SkillOpt — the skill/memory doc is trainable text; bounded add/delete/replace edits; accepted only through a held-out gate; rejected edits become negative feedback. Claude Dreams — offline consolidation that reads past sessions and rebuilds memory (dedup/merge/resolve); the input is never mutated; output is reviewed then adopted. Agent sleep — periodic offline replay turns episodes into durable skill. When to use this skill Trigger when the user wants any of: "make my agent learn from how I use it" / "get better the more I use it" / "remember my preferences across sessions" a nightly/scheduled or on-demand offline self-improvement / dream / sleep run to review past sessions/trajectories and distill recurring tasks to consolidate feedback into CLAUDE.md or a managed skill to schedule the cycle (cron) or adopt a staged proposal The cycle (six stages) 1. Harvest — read ~/.claude/projects//<session>.jsonl + ~/.claude/history.jsonl (READ-ONLY) → session digests. 2. Mine — digests → TaskRecords (recurring intents + outcome labels + checkable refs where possible). 3. Replay — re-run tasks offline under the current skill+memory → (hard, soft) scores. 4. Consolidate — reflect on failures → propose bounded edits → gate on a held-out slice; accept only if it strictly improves. 5. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills alirezarezvani/skillopt-sleep--71685a