← ClaudeAtlas

clean-my-looplisted

Audit and clean the persistent context that feeds a recurring autonomous agent loop — memory files and indexes, scheduled-task / automation prompts, and CLAUDE.md / AGENTS.md — so the loop stops degrading into a self-reinforcing echo chamber. Works for Claude Code /loop crons and Codex automations.
wquguru/skills · ★ 75 · AI & Automation · score 75
Install: claude install-skill wquguru/skills
# clean-my-loop A recurring autonomous loop (Claude Code `/loop` cron, Codex automation) re-reads the same context every iteration: its memory/state files, the scheduled-task prompt, and CLAUDE.md / AGENTS.md. Those artifacts **decay**: memory grows into a changelog, task rules acquire no-exit "skip on error" clauses, instruction files give the loop cover to feel productive while defeating its own purpose. The decay compounds — each iteration re-reads the bloated state and writes more of it back. The result is a degenerate loop: lots of motion, no progress. **This skill diagnoses that decay with evidence and fixes it.** This is a destructive-edit + behavior-change task on the user's automation. **Move carefully, show evidence before editing, and put the irreversible / judgment calls behind `AskUserQuestion`** (see Step 4). ## When this applies The user points at a loop and says it feels stuck, repetitive, bloated, expensive, or "off" — or just asks to clean / health-check a `/loop` cron or Codex automation. If no loop is named, ask which one (Step 1). ## Workflow ### 1. Scope the target Identify exactly one loop to clean. If the user named a repo/automation, use it. Otherwise enumerate candidates and ask via `AskUserQuestion`: - Claude Code crons: call the `CronList` tool; also `cat <repo>/.claude/scheduled_tasks.json` and `~/.claude/scheduled_tasks.json` if present. - Codex automations: `ls ~/.codex/` and look for an automations/scheduled config; check the repo fo