Best model for refactoring

Curious to here what model people have had best success with for keeping code clean/well organized. I end up using a mixture of models (Gemini Pro is the go to rn, but if that gets stuck I use other models). Individual code changes are pretty good in quality, but I feel like code getting long/could be refactored better & it’s harder for me to tell which models are “good” at this vs. “getting a feature to work”. Besides just code-in code-out they have to be good with tools to work with multi-file refactoring. (As an aside I’d love to see a benchmark for this, have not come across it)

1 Like

Yes would also like to see some real comparison with the same task and codebase.

From the forum overall there are some for whom Gemini Pro works great, others have issues with it and prefer other models, so there is no clear ‘winner’ that works for everyone.

I did a large refactor last week (probably over 10k lines) and it went pretty well with Gemini Pro.

I migrated an express api application to NestJS. What made the biggest difference was the following:

  1. I had Cursor (in the old express app) generate a detailed explanation of the core parts of the application (I focused on one very heavy endpoint). I told it that this was going to be provided to a team working on migrating to NestJS. I had it saved as an md file in the project.

  2. I copied that md file into the new nestjs project and then had Cursor in read that file. I then asked it to generate a detailed implementation plan and save it to a new md file in the project.

I spent the next 2 days having Cursor just execute that implementation plan and generate new documentation as it went along.

So now I have a markdown file that documents the migration, a document that documents the implementation steps and another that documents the new code.

It was super helpful.

It has become a new process for me. Any time I work on something, I have Cursor updte the docs for that code to keep logic and docs aligned.

5 Likes

I thought this was just common practice tbh, any time I make changes I had a Plan.md, a Roadmap.md and a To-Do-List.md that tracks all changes and is frequently updated to reflect the changes vs my other md’s and have them fully updated when making significant changes.

On this note i would like to say how bad gemini flash is, it just inserts the thinking content into the file instead of actual response, let alone actually refactor the file.. would be great if this was fixed as it is fast and cheap

Gemini Flash 2.5 doesn’t have a thinking mode.

1 Like

i know, that is why it is even more weird, it inserts <thinking>...</thinking>

Meanwhile I’m tried using Grok-3-Beta which should now be using it’s thinking mode but it still doesn’t work in Cursor despite Cursor saying it should… Poor Grok-3-Beta is being kneecapped so hard it cannot compete despite it having the needed functionality…

1 Like

It probably is. haha.

I’m not a coder, just hacking away at a project and learning as I go.

1 Like

I used to code like over a decade ago but due to physical issues I cannot type long enough to code anymore, so for me things like Cursor AI have really changed things and allowed me to get back into coding.

For me it’s like having a professional assistant do for me what I cannot do myself anymore.

2 Likes

I hear you, I’ve recently started using the auto dictation on my MacBook and it’s working wonders. I don’t know if you’re on a PC or a Mac but the Mac has an excellent auto dictation. (written using auto dictation) :grin:

Not really.

Eh, Cursor really needs to fix discrepancies in their model page.. It’s so confusing as user when the model page says one thing but in reality it’s different in the App.

1 Like

Yeah, agreed the Cursor team should update docu. Can you point me in the right direction what is a discrepancy or confusing? I will try to reproduce it.

The models page says Gemini 2.5 Flash only has Agent functionality, no thinking.


But in Cursor it does have thinking..

It’s really unhelpful when the web docs do not reflect the actual models capabilities in the App, it also makes you question if other info could be incorrect to like Context sizes etc.

1 Like

Thank you, I flagged it for Cursor team. The update might not be realtime but its forwarded.

Yeah, but do you keep these files? My codebase has well over 100 Markdown files just for these cases and the codebase is already huge with over 350K LOC.