Notifications
Clear all

Top Claude Code skills for optimizing large scale Java legacy projects?

3 Posts
4 Users
0 Reactions
51 Views
0
Topic starter

So my team just inherited this absolute beast of a legacy project—think Java 8, XML configs everywhere, and zero documentation from a team that left like five years ago. We are based out of Chicago working for a mid-sized bank and they gave us a tight 3-month deadline to basically modernize the core modules or the whole thing gets scrapped. I've been playing around with the new Claude Code CLI lately and I'm really torn on how to actually point it at this mess.

Option 1 is focusing heavily on the deep context mapping to just understand the dependency hell before we touch anything. Option 2 is using it for aggressive unit test generation because right now we have like 5% coverage and I'm terrified of breaking things. I'm leaning toward the deep context stuff but I'm worried it'll burn through our $200 monthly token budget way too fast if it's scanning 500+ classes constantly.

Is it better to have Claude focus on modularizing the monolith first or should I prioritize the test suite expansion to make sure we dont break the legacy logic? I want to make sure I'm using the right skills or commands for a project this big without blowing the budget in week one or hitting a wall with the context window...


3 Answers
11

Building on the earlier suggestion, I had issues with Claude Code draining the budget way too fast on massive repos. Honestly, it is not as good as expected for full-scale mapping. Unfortunately, you will go broke. Use OpenRewrite Refactoring Tool for the Java 8 migrations instead—it is free and handles refactoring better. Also, check JProfiler 14 Java Profiler to find actual bottlenecks before wasting tokens on irrelevant classes.


10

To add to the point above: prioritizing tests is definitely the move. To keep costs down with 500+ classes, try mixing your tools:

  • Run SonarQube Developer Edition to map debt without burning tokens.
  • Use Claude specifically for generating JUnit 5 Testing Framework suites for the trickiest modules.
  • Rely on IntelliJ IDEA Ultimate 2024.1 for automated refactoring once tests are solid. It's a more methodical way to manage that tight budget.


1

Whoa, legacy Java 8 projects are basically my bread and butter and honestly, Claude Code is a total lifesaver for this specific kind of pain! I have been there with the Chicago bank scene too, it is wild how much old code is still running the world lol. Ngl, you should 100% prioritize the unit test generation first. Trying to modularize a monolith without a safety net is like doing a tightrope walk over a volcano... its just asking for a production outage. If you are using JetBrains IntelliJ IDEA Ultimate Edition 2024.1 alongside the CLI, you can actually have Claude analyze specific classes one by one to keep that budget in check. Scanning 500+ classes all at once will definitely nuke your budget in a week, so dont do that!

  • Use the /map command first just to see the high-level structure without deep-diving into every single line.
  • Run the /test command on your most critical service classes to get that coverage up to at least 40% before touching any logic.
  • Target the most coupled classes first using the Anthropic Claude 3.5 Sonnet API through the CLI because it is fantastic at spotting weird side effects in legacy code. It is amazing how much better it performs when you give it tight constraints. I did this for a similar project last month and managed to stay under my limit while hitting decent coverage. Love it!


Share: