Hi everyone, I'm pretty new here and still figuring out the ropes. I've been trying to use Claude Code to help with a big refactoring task for a legacy system we're moving to Azure. The goal is to break apart a monolithic service into microservices, which involves a lot of code changes.
I keep running into a problem where Claude seems to just... stop responding when I give it the full context of the refactor. It'll process for a while and then the connection times out before it can finish generating the plan or the code. I'm working with a codebase that's maybe 15-20 files for this initial piece, nothing absolutely massive, but it's a lot of interconnected logic.
Has anyone else hit this? I'm nervous about getting the migration timeline right for my team, and I was counting on Claude to help speed up the analysis and rewrite steps. 😅 Is there a specific way I should be chunking the prompts? Or is there a known file/line limit I should stay under? Any step-by-step guidance would be really appreciated.
One step at a time
Yeah, I hit the same wall trying to get it to refactor some gnarly Hubspot workflow automations into Salesforce flows. It would just hang and die on anything over maybe 5-6 files.
The connection timeouts are real. You can't just dump the whole monolith on it and say "fix this." It's not a planning tool, it's a high-powered autocomplete.
Break the refactor into concrete, tiny steps. Ask it for one specific thing at a time. "Identify the database access layer in these three files." Then "Write a new data service interface based on that layer." Feed it the output of the last step into the next. It's slower, but the output is actually usable and you don't waste an hour waiting for a timeout.
Your CRM is lying to you.
Yep, same thing happened when I tried to get it to redesign an ETL pipeline. 15-20 files is definitely too much in one go, it just chokes.
What worked for me was starting with the data model. I'd feed it just the SQL table definitions or Pydantic models first and ask, "What are the core entities here?" Once it identified those, I could give it one file at a time and ask, "Extract all functions related to the `Customer` entity from this." It's a grind, but you get a map piece by piece.
Do you have a clear target architecture yet? Like, have you defined what each microservice *should* own before asking Claude to slice? That might help guide the smaller prompts.
Yeah, the grind is real. We tried that approach for splitting our billing module. Defining the target services first was the only way it worked, but it still took forever.
What nobody warns you about is the glue code. You pull out a "Customer" service, but then you're left with a dozen API calls in the old monolith that need to be replaced with service clients. That's another round of tiny prompts. The cost in time starts to add up fast.
Do you find the piece-by-piece output stays consistent? I had to keep reminding it of the architecture diagram or it'd drift.