# Reducing complexity via agentic refactoring? — retained record

> Retained reddit record from reddit:ClaudeCode.

Canonical: https://highsignal.app/data/records/39b2680a9a416b48

[← sources](https://highsignal.app/data)


source: [reddit](https://highsignal.app/data/reddit) (reddit:ClaudeCode)  published 2026-11-17 00:58 ingested 2026-11-18 02:42

[original source ↗](https://www.reddit.com/r/ClaudeCode/comments/1xy6s7x/reducing_complexity_via_agentic_refactoring/)

## retained text



```
I’m looking at [https://github.com/SprocketLab/slop-code-bench/tree/main](https://github.com/SprocketLab/slop-code-bench/tree/main) and they suggest that the **complexity of AI agentic code only increases**. The initial “write clean code” instruction can lower the initial complexity of the initial output, but by the 4th addition, complexity is high.

Frontier models get single digit percentage improvements in terms of reducing complexity over 4 modifications.

**It’s almost like Claude and other agents love adding code more than deleting code.**

I want to know of the “initial” gains may be multiplied by multiple rewrites from an ever better spec.

With this in mind, has anyone implemented some sort of **“garbage” collection style refactoring workflow** to reduce this complexity?

What I mean: writing code is so cheap, that it feels to me like “stop and copy” may be possible to shake the “garbage” out of decoupled components written against interfaces. Old options nobody uses, obsolete style, versioning that is not maintained.

I can not do this if everything is mixed together, but for a single component, living in a self - contained folder:

1)Extract the spec, have Opus-extra review this,   
2) define pseudo code function definitions   
3) have agent re-implement the component from spec as a brand new file, with clean code instructions.  
4) test against an existing protocol and test suite

Is this reinventing the wheel? **Is anybody else experimenting with “rewrites are cheap” refactoring?**
```



document fetched 2026-11-18 00:45 · canonical https://reddit.com/r/ClaudeCode/comments/1xy6s7x/reducing_complexity_via_agentic_refactoring
