Using Claude for refactoring code is pretty awesome.
You connect it to your GitHub repo, mark the files you want it to be aware of, and then start interacting.
I had this clunky code I wrote that awhile back that scrapes some RSS Feeds and then inserts the items into Notion.
I literally cobbled it together piecemeal over the course of a few days a year ago to pull some useful articles out of Google Alerts.
Like most C# projects that you just hack together, it's generally one long "program.cs" file and because I was using GitHub to run it with Actions, I had a YAML file as well.
The more I added, the more brittle it became, I had hashing URLs in there, I had code that was querying Notion to make sure items were unique before injecting them, I had code that deleted older items or duplicates that snuck past.
Literally, this thing had ballooned out to like 3500 LOCs and was routinely taking 14-15 minutes to run as a GitHub action. LOL.
I created a Claude Project, linked the Repo, and said, "We're going to refactor this."
Throughout two evenings after work (I used up all of my "quota" yesterday for 3.7 Sonnet as a Pro user) we've been able to completely refactor the code.
I kind of knew how I wanted it to function but I decided to let Claude have a pass at it without too much prompting.
It first told me I needed some "models". I gotta be honest, I'd not really cared or considered that but it was a good small starting point.
Then it worked out seven different service classes I could create from the main program file.
What was interesting was that it was very focused on "Separation of Concerns".
I have to be honest, my refactoring plan was probably going to go down the microservices route so when I challenged Claude it replied, and rightfully IMHO, that the application didn't require that level of refactoring unless it was doing considerably more volume than it could estimate.
So anyway, there were a couple of things it was a bit hamfisted with - GitHub Secrets for API Keys, missing Dependency Injections for the service classes it was creating, etc... - but for the most part, it was super impressive.
The code is now 90% refactored, runs fully in under 3 minutes as a GitHub Action, so it's 5x faster, and the logging that's been added makes so much more sense.
If you're a full-time developer and very meticulous about your architecture, then I imagine that something like GitHub CoPilot is probably pretty good for you, but for someone who doesn't program consistently and knows enough to be dangerous, Claude is exceptional for peer review and refactoring help.