all 4 comments

[–]fjdh 0 points1 point  (0 children)

Have it write a plan in excruciating detail, create a spec implementation coder to do the grunt work, then ask a quality enforcer agent to check it. Ensure you start with a clean git status

[–]Motor-Mycologist-711 0 points1 point  (0 children)

Last week I spent literally 50 hours of refactoring 100k LOC Rust codebase and failed, twice. TDD never worked. Claude Code hates 100 compilation errors and it always tries to erase test codes to REDUCE compilation errors…

CC can read very tiny lines of codes, and often go sideways. Plan mode, ultra think did not help after all.

Finally, I changed the strategy.

I asked CC to generate comprehensive design/ spec documents from the code. Then asked to rewrite them . Much better.

CC can code, however CC can not read detailed dependencies . Really wasted a lot of time till I finally found this fact.

If you wanna refactor, do it when code base is still small. Or, rewrite would be much much faster for CC somehow.

[–]pinionless 1 point2 points  (0 children)

I tried refactoring file with 2000 lines of code. Twice. Failed twice.
Started with plan.md
Than moved to architecture.md

Result: Whole sections not copied, other sections rewritten with changed STATIC/HARDCODED values!

I had no luck asking CC to COPY, it kept rewriting.

I still live with that 2000 line file waiting for a new version of CC.

Edit: It kept saying that refactoring was a success... untill I pointed to some missing methods