- Home
- Skills
- Agents & Orchestration
- Sleep — prune and consolidate your Claude Code memory
More screenshots
Works with the AI Agents you already use
Sleep — prune and consolidate your Claude Code memory
Your Claude Code memory folder only grows. Sleep backs it up, rule-scans for dead paths, stale and orphan notes, lets the AI find duplicates, and changes nothing until you approve.
Free
Sleep — prune and consolidate your Claude Code memory
Example session with this skill installed
/sleep — my memory for this project feels bloated, tidy it up
- Read your context and instructions
- Compiled the sleep
Summary
Backed up 19 memories, scanned them, and proposed 6 changes. You approved all 6. Boot injection went from
4,730 → 4,180 tokens (budget 5,000). Nothing was deleted.
Backup: %LOCALAPPDATA%\Noema\sleep\backup\my-app\2026-11-13T09-12-04 (copy it back to undo).
Scan (rules only, no AI tokens)
| Group | Count | Tokens |
|---|---|---|
| ⚠ Hot and suspicious | 1 | 610 |
| Dead paths | 2 | 880 |
| Past review date | 1 | 140 |
| Cold | 3 | 520 |
| Orphan (cold + no links) | 1 | 310 |
| No rule flags | 13 | — |
deploy-notes.md is read in almost every session (22 reads) but points to D:/work/my-app/scripts/deploy.ps1, which no longer exists. That is the most dangerous kind: wrong and trusted.
Proposal (you approve, then it changes things)
| Group | File | Tok | Action | Reason |
|---|---|---|---|---|
| ⚠ Hot | deploy-notes.md | 610 | fix | Script moved to tools/deploy.ps1 |
| Dead path | api-keys-setup.md | 270 | fix | Folder renamed, new path found |
| Duplicate | release-flow.md | 420 | merge | Same topic as deploy-notes.md |
| Compress | project-status.md | 980 | compress | Dated log → one line of current state |
| Review | promo-2025.md | 140 | archive | Campaign ended |
| Cold + orphan | legacy-cron.md | 310 | archive | Unread for 96 days, no links |
Compress example for project-status.md:
- Before: "11-02 started auth refactor; 11-05 hit token bug, tried X, then Y; 11-08 merged; 11-10 deployed"
- After: "Auth refactor is live (2026-11-10)."
Wake
- Handled: 2 fixed, 1 merged, 1 compressed, 2 archived (moved to
memory/archive/, listed inARCHIVE.md). - Links pointing to
release-flow.mdnow point todeploy-notes.md. - Boot injection: 4,730 → 4,180 tok (budget 5,000). Memory: 19 files / 7,940 tok → 17 files / 6,610 tok.
- 1 entry in
archive/is older than 30 days and unread. It can be purged if you ask; I won't do it on my own.
Next steps
- Run
/sleepagain in a few weeks, or when the boot-injection number creeps toward your budget. - Add
review: YYYY-MM-DDto time-sensitive memories so the next scan flags them on time.
Connects securely to your tools. The creator never sees your data.
About this skill
Claude Code's auto-memory gets loaded at the start of every session. Over weeks it fills up with progress logs, dead paths, duplicates and notes nobody reads, and you pay for all of it in context tokens, every session.
Sleep does what the brain does overnight: it consolidates experiences into conclusions and prunes weak connections. Say "sleep" or run /sleep:
- Backup: the whole memory folder is copied first, so every run can be undone.
- Rule scan, with no AI tokens spent:
- local paths that no longer exist
- notes past their
review:date - memories never read in your transcripts (cold)
- orphans with no links in or out
- files missing from the
MEMORY.mdindex - hot and suspicious: read often and flagged, the most dangerous kind
- AI pass, only on what rules can't judge: duplicates, and entries that mix a conclusion with its history and can be rewritten as one line of current state.
- Proposal table: grouped by reason and sorted by tokens. Each row gets one of four actions: fix, compress, merge, or archive. Approve it in batches, for example "all dead-path ones, yes".
- Wake: you get a before → after report of boot-injection tokens against your budget.
What it never does
- It never deletes anything outside
archive/. Stale memories are moved there, and the index is updated. - It never acts without your approval.
- Purge permanently deletes files, only from
archive/, and only when you explicitly ask for it.
Works on its own
If you also run Noema, a free floating window that shows your memory as a 3D neural network, it plays the whole thing live: dimming into sleep, scanned connections lighting up, and the token delta on waking.
Requirements: Claude Code with auto-memory, Node.js. Tested on Windows.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.
Requires local Node.js. Does not validate external URLs. No automatic purging. Users must approve batches of changes manually.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 4 days ago
- Free with an Agensi account
- Software
- Claude Code with auto-memory
Node.js
- Optional
- Noema (free 3D memory viewer) for the live animation
Permissions
File Scopes
Reads the memory folder and your session transcripts (to count which memories were read). Writes only a report and a backup under %LOCALAPPDATA%\Noema\sleep, and edits memory files only after you approve. LOCALAPPDATA is read to locate that folder.