Codebase-wide analysis and prototypes with Claude Code
TL;DR
Claude Code isn’t only for writing features. It can read your whole code base and give you a list of inconsistencies to fix, and it can build three versions of a design so you can pick one. Think big.
How it works
Analysis. Claude reads more code for one question than you would in a week, and it doesn’t get bored. Some things worth asking for:
- Every way you write the same HTML and CSS (buttons, spacing, form layouts), with how often each one occurs and a proposal for which one should win.
- Tests that do the same thing in different ways: setup, test data, mocking, assertions.
- Test classes that make Spring start a new application context instead of reusing a cached one (a different
@MockitoBean, profile or property set), and how to group them so the suite gets faster.
Prototypes. Claude can write several versions of the same thing in the time it takes you to write one: three layouts for a screen, two shapes of an API.
My take
- Think big. Ask questions about the whole code base that you’d never have time to answer yourself.
- Ask for a report, not a change. Get a list you go through and decide on. Then fix the items you agree with, one category at a time, in slices, like any other change.
- Prototype before you build. Before building a screen, ask for three different designs as throwaway pages. Look at them side by side, pick one or combine parts, delete the prototypes and build the real thing. Two versions of an API, written out, are easier to judge than two descriptions.
Gotchas
- The report isn’t a verdict. Some items are wrong and some aren’t worth it.
- A refactor across 200 files can’t be reviewed.
- Prototypes turn into production code. They were built to answer a question, not to last.
Example
Go through all templates and stylesheets. List every kind of element we style in more than one way. For each one, show the variants with a count and an example file, and propose which variant should win. Write it to
docs/css-inconsistencies.md. Don’t change any code.