deep-clean

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

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.

agentmods
npx agentmods add skills/opencue/cuecards/deep-clean
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.

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. Scan, not verified.
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 $0.00087 $0.03807
Opus 5 $0.00044 $0.01903
Sonnet 5 $0.00017 $0.00761
Haiku 4.5 $0.00009 $0.00381

Measured 3d ago against content hash 5fa9b5e72710, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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. 3d 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 (5 stars, last pushed 3d ago), licensed MIT. It adds 87 tokens to every session and 3,807 once invoked, about $0.0004 per session on Opus 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

hermes-self-evaluation

Use this skill when the user asks to audit, review, or optimize Hermes's own performance — analyzing session data, skills, configuration, costs, and usage patterns to identify improvements, automation opportunities, and system optimizations.

AtlasOmnia/donna-starter · 69 tokens

janitor-security

Heuristic security scan of installed skills — prompt-injection phrases, hidden unicode instructions, credential-store access, network-pipe-to-shell and payload-smuggling patterns. Use when the user asks 'are my skills safe', wants to scan skills for prompt injection or malware patterns, or before trusting a newly…

khendzel/skills-janitor · 73 tokens

skill-auditor

Use when auditing Hermes skills for broken references.

frgmstr/hermes-manager · 14 tokens

hermes-self-evaluation

Use this skill when the user asks to audit, review, or optimize Hermes's own performance — analyzing session data, skills, configuration, costs, and usage patterns to identify improvements, automation opportunities, and system optimizations.

AtlasOmnia/hermes-custom-pack · 69 tokens

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