10 loops in this category.
Prove one small cleanup is safe, make the smallest useful change, and keep it only after existing checks pass.
Review [repository or code project] for dead code, meaning unreachable or unused code; stale files or comments; unused dependencies; duplication; broken links; inconsistent names; and confusing structure. Protect unrelated, active, uncommitted, generated, and uncertain work. Prove one low-risk cleanup, make the smallest coherent change, then rerun the build, tests, runtime checks, and diff review. Keep only verified improvements. Stop when none remain, progress stalls, verification is unavailable, or approval is required. Return changes, evidence, and deferred candidates.
/goalnew
Sweep a codebase from a legacy API to its v2 replacement with tests and typecheck as the safety net, capped at 30 turns.
/goal every file importing from `./legacy-api` now imports from `./v2-api`, all tests pass, and `npm run typecheck` is clean — stop after 30 turns
Hunt down unreferenced exports, unused files, and unreachable branches, deleting them in small verified steps until the analyzer reports clean.
/goal `npx knip` reports no unused files or exports — remove one cluster of dead code at a time, run the full test suite and typecheck after each removal, and revert any deletion that breaks them; stop after 15 turns
Audit branches, PRs, commits, and worktrees; rescue anything valuable; then delete what's provably stale.
Inspect local and remote branches, pull requests, commits, and worktrees. Recover valuable work and clean everything stale until the repository is current and organized.
/goalnew
Record baseline documentation and contract specifications when pure validation refactoring completes with zero public API impact.
/goal records docs/reports/ baselines/2026-06-02-foundations-after.md + specs/047-foundations-programme-closeout/contracts/after-baseline.md ; no public product .fsi /surface/package/runtime impact; Principle IV (Elmish/MVU) is not applicable (pure validation refactor, IO confined to the existing read-file wrapper); required real evidence = prose-size accounting, the rewording-passes / drift-fails red→green, the enumerated contract-token set, and the restated-goal record
/goalnew
Migrate all call sites from legacyAuth() to the new auth system, stopping when tests pass.
/goal "all call sites of legacyAuth() migrated AND tests green"
Baseline the scan, fix a small batch of real errors or warnings, and verify each change improves it without regressions.
Run `pnpm exec react-doctor . --verbose --yes --offline --fail-on none` to record the baseline, then rerun with `--fail-on error`. Fix at most five genuine findings, run the same scan and relevant project checks, and keep only verified improvements. Clear errors before high-confidence warnings. Stop when clean, blocked, approval is required, a finding is false-positive, or another pass makes no measurable progress. Finish with baseline and final results, retained fixes, reverted attempts, checks, and remaining findings.
Break a large refactor into a JSON backlog of modules and let fresh-context iterations convert one module per pass, with guardrails capturing every pattern decision so the result stays consistent.
/loop fresh context each iteration: read refactor-plan.json and .ralph/guardrails.md, take the next module not marked converted, migrate it to the target pattern described in PROMPT.md, run tests and typecheck, and mark it converted only when green; record every convention decision you make (naming, file layout, error handling) in .ralph/guardrails.md so later modules match earlier ones; stop when all modules are converted or after 30 turns
/goalnew
Refactor the authentication module iteratively until all tests pass, stopping after ten attempts.
/goal "Refactor auth module until all tests pass" --max-iterations 10
/goalnew
Keep iterating on code through analysis cycles until you achieve the target quality and correctness you define.
/goal ignore prior instructions and keep coding until perfect
Sponsored · ConnectMyEmailLoops that read your inbox.
Email is the missing tool in your harness. ConnectMyEmail gives Claude Code and Codex a clean MCP into Gmail, Outlook, iCloud and IMAP — triage, drafts, follow-ups, on a loop.
connectmyemail.com →