deep-clean

deep-clean is a skill for Claude Code, Codex from opencue/cuecards. It costs 87 tokens per session (3,807 once invoked), scanned A, original, MIT.

A cleanup tool for an AI coding agent’s instruction files, rules, skills, and memory. It finds outdated paths, duplicate or conflicting instructions, and rules for technologies the project no longer uses.

In plain words
What is it for?
It is for auditing and consolidating agent configuration, context files, rules, skills, and memory, with a dry-run report before changes are applied.
Why use it?
It removes confusing or obsolete guidance that can lead the agent to make incorrect changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument; installed under .agents/ (shared by several agents); mentions AGENTS.md.

Good fit It is for auditing and consolidating agent configuration, context files, rules, skills, and memory, with a dry-run report before changes are applied.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/opencue/cuecards/deep-clean
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add opencue/cuecards --skill deep-clean
Clone the repo
git clone --depth 1 https://github.com/opencue/cuecards

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for deep-clean

README.md
[![agentmods](https://agentmods.dev/badge/skills/opencue/cuecards/deep-clean/github.svg)](https://agentmods.dev/skills/opencue/cuecards/deep-clean)
Your own site
<a href="https://agentmods.dev/skills/opencue/cuecards/deep-clean"><img src="https://agentmods.dev/badge/skills/opencue/cuecards/deep-clean/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for deep-clean

Your own site · 80×15
<a href="https://agentmods.dev/skills/opencue/cuecards/deep-clean"><img src="https://agentmods.dev/badge/skills/opencue/cuecards/deep-clean.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,807 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00087 $0.03807
Opus 5.5 $0.00035 $0.01523
Sonnet 5.5 $0.00017 $0.00761
Haiku 4.5 $0.00009 $0.00381

Measured 1mo ago against content hash 5fa9b5e72710, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

deep-clean scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 2 executable files (clean-hook.sh, should-clean.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/deep-clean/SKILL.md · 410 lines

How it starts

The opening of the file, as written. The whole thing — 410 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Deep Clean — Full Configuration Consolidation for AI Coding Agents

Dream cleans your memory. Deep Clean cleans everything.

Most dream/consolidation skills only touch memory files. Your context files, rules, and skills rot just as fast — stale file paths, rules for a stack you don't use, duplicated directives, vague instructions no agent can follow. Deep Clean fixes all of it.

Works with: Codex, Cursor, Codex, Gemini CLI, GitHub Copilot, Windsurf, and any agent supporting the SKILL.md standard.


What It Does

Phase 0: DETECT      → Identify which agent is running, resolve paths
Phase 1: AUDIT       → Scan everything, report problems
Phase 2: CONTEXT     → Consolidate the main context file
Phase 3: RULES       → Clean up rules directory
Phase 4: SKILLS      → Audit installed skills
Phase 5: MEMORY      → Standard dream consolidation
Phase 6: VERIFY      → Validate all changes

How to Run

Run /deep-clean manually, or say "run deep clean" in any session. First run always does a dry run (report only, no changes) unless you explicitly say "run deep clean and apply changes".


Phase 0: DETECT AGENT

Goal: Identify which agent is running and set paths for the rest of the process.

Agent detection

Check which directories exist to determine the active agent:

# Detect agent by directory presence
ls .Codex/ 2>/dev/null && echo "AGENT: Codex"
ls .cursor/ 2>/dev/null && echo "AGENT: cursor"
ls .gemini/ 2>/dev/null && echo "AGENT: gemini-cli"
ls .agents/ 2>/dev/null && echo "AGENT: codex/universal"
ls .windsurf/ 2>/dev/null && echo "AGENT: windsurf"
ls .github/copilot/ 2>/dev/null && echo "AGENT: copilot"

Set variables for all subsequent phases

Based on the detected agent, use these paths throughout:

Variable Codex Cursor Gemini CLI Codex Windsurf
CONTEXT_FILE AGENTS.md .cursorrules GEMINI.md AGENTS.md .windsurfrules
RULES_DIR .Codex/rules/ .cursor/rules/ .gemini/rules/ .agents/rules/ .windsurf/rules/
SKILLS_DIR .Codex/skills/ .cursor/skills/ .gemini/skills/ .agents/skills/ .windsurf/skills/
MEMORY_DIR ~/.Codex/projects/*/memory/ ~/.cursor/projects/*/memory/ ~/.gemini/memory/ ~/.agents/memory/ —
ARCHIVE_DIR {RULES_DIR}/_archive/ {RULES_DIR}/_archive/ {RULES_DIR}/_archive/ {RULES_DIR}/_archive/ {RULES_DIR}/_archive/

Read the full file on GitHub · 410 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 410 lines · 87 tokens per session scan A 5fa9b5e72710

Subscribe to this mod's changes

deep-clean is a skill published in the GitHub repository opencue/cuecards (6 stars, last pushed yesterday), licensed MIT. It adds 87 tokens to every session and 3,807 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

agent-dreaming-agnostic

Memory-agnostic background consolidation — reviews sessions, scores candidates, promotes durable insights to the active memory backend (built-in MEMORY.md or Holographic). Three-phase (Light/Deep/Condensation/REM). Run via cron or manually.

nexus9888/hermes-memory-skills · 57 tokens

agent-dreaming

DEPRECATED — use agent-dreaming-agnostic instead. Background memory consolidation for built-in MEMORY.md only.

nexus9888/hermes-memory-skills · 28 tokens

report

Writes the session final report to a file, then prints only the path and a one-line summary. Fires when the prompt contains "Report per memstack:report", and also when the prompt begins with a standing trigger configured through MEMSTACKREPORTONTASKPROMPTS or MEMSTACKREPORTTRIGGERS. Dormant otherwise.

cwinvestments/memstack · 67 tokens

token-optimization

Use when the user says 'token optimization', 'save tokens', 'context window', 'reduce tokens', 'token stack', or 'TokenStack', or asks about extending context window capacity. Covers TokenStack, the built-in compression proxy that shrinks Claude Code tool output before it reaches the Anthropic API. Do NOT use for…

cwinvestments/memstack · 79 tokens

compress

Use when the user says 'tokenstack', 'compression', 'token savings', 'proxy status', or asks about context window usage.

cwinvestments/memstack · 29 tokens

state

Use when the user says 'update state', 'project state', 'where was I', or at session start to load current context.

cwinvestments/memstack · 29 tokens