Untangle Codebase
Code qualityOne-pass refactor of a whole codebase: finds hidden links, duplicated logic, wrappers and workarounds, then fixes them.
Install
$ /plugin marketplace add caldoai/skills
Works with Claude Code. Its skills also install in other agents: pick one above.
Update
$ /plugin marketplace update caldo-skills
Then run /reload-plugins.
When to use it
- An AI-built codebase has grown copies of the same logic, pass-through wrappers and one-off special cases.
- A typical change now touches many files, or agents keep breaking things without noticing.
- Agents burn tokens searching because related code is scattered across layers.
Commands & flags
- /plugin install untangle-codebase@caldo-skills
- Install the plugin after adding the marketplace.
- /untangle-codebase
- Start the refactor on the whole codebase.
- /untangle-codebase checkout flow
- Optionally pass an area or concern to focus on.
- npx skills add caldoai/skills --skill untangle-codebase
- Alternative install through the skills CLI.
How to use it
The skill is set to invoke only when you type it, so run /untangle-codebase yourself; it will not auto-trigger. It first asks whether to also remove comments that only restate the code and tests that could never catch a real bug.
Then it works through five steps: list every problem without changing anything (hidden links, needless links, surplus code and special cases such as a swallowed exception, a retry, a sleep or a disabled test), redesign from first principles, fix everything on the list, then have subagents re-check and repeat until nothing worth fixing is left. A decision log keeps the work coherent across compaction.
It is a large, multi-file refactor. Start from a clean git branch with passing tests, and review the diff; do not run it on a codebase with no tests unless you accept that risk.
Why it earns its place
It treats duplicated logic, thin wrappers and temporary workarounds as symptoms of one question: should these pieces change together? Fixing the cause, not each special case, is what makes later changes land in one place and keeps agents from searching widely for every edit.
Try it
> /untangle-codebase focus on the billing module