Hey guys, I was testing the new /loop functionality and wondered if it could work with the code-simplifier plugin. I always use the plugin but sometimes have problems having to run it a lot and specify which files every time. So the solution? Create a loop prompt that tells Claude to create a tmp file (like a memory) of the files it needs to pass through, spawning batches of 10 agents with the plugin on those files. It marks the ones it finished in the file. Every 10 minutes a new job starts, reads that file, and continues where it left off until it finishes and warns you. Here’s the prompt: Read the file tmp/code-simplifier-loop-tasks.md. If it doesn’t exist, create one listing all source files. Pick ALL pending files (up to 10 at once) from the list. For each one, launch a code-simplifier:code-simplifier agent in the background. Append this instruction to each agent’s prompt: “After finishing, do not commit or modify other files.” After all agents finish, run all three checks: [PUT specific checks for your tech stack here — e.g. cargo clippy, tsc --noEmit, eslint] If any check fails, fix the issues before continuing. Once all files pass all checks, update tmp/code-simplifier-loop-tasks.md — mark those files as “[x] done” with a short note of what changed. If all tasks are marked “[x] done”, output “ALL COMPLETE — cancel this loop with CronDelete”. Basically set it and forget it — come back to a cleaner codebase. Another tip, create a new branch before doing this. This way you can leave there and check later if you liked the new codebase or not. submitted by /u/binatoF
Originally posted by u/binatoF on r/ClaudeCode
