Hand a messy codebase to Claude Code and get a pull request back
Install Claude Code, point it at a real repo, and have it refactor a tangled file, write the tests to prove nothing broke, and open the PR — while you review instead of type.
What this looks like
One step on screen at a time. Read it, do it, tap Next.
Hand a messy codebase to Claude Code and get a pull request back
Step 1 of 11
Understand the deal you are making
Claude Code is not autocomplete — it is an agent that reads your repo, edits files, runs commands, and shows you every change before you accept it. Your job shifts from writing code to revie
Checkpoint
You know your role: reviewer and approver, not typist.
Before you begin
Tick these off as you sort them. Stopping halfway to create an account is how a fifteen-minute build becomes an hour.
0 of 8 ready
Ticks are saved on this device, so you can come back to them.
- Account
Pro and Max plans include Claude Code usage; Team and Enterprise can enable it. You sign in with your Claude account — no separate API key needed.
- Have ready
Pick a project you know well enough to review confidently. A personal project or an internal tool is perfect; do not practise on production code you do not understand.
- Know-how
You should know how to create a branch, read a diff, and open a pull request. Claude Code does the typing, but you stay the reviewer — that only works if you can read what it changed.
- Permission
Claude Code installs through npm and runs in your terminal. Check with `node --version` before you start.
- Time
Ten to install and orient, twenty for the refactor and PR.
The basics — ticked once, remembered everywhere
- Account
Either the hosted version or a self-hosted install. Everything here works the same on both — the only visible difference is the shape of your webhook URLs.
Create a workspace - Know-how
Adding a node, connecting two of them, and pressing Execute. If any of that is new, the free primer covers it in about ten minutes.
- Credential
You will paste at least one secret during setup. A password manager beats a notes app, and it stops you pasting a live key into a chat window by accident.
The shape of the setup
The Claude features you will touch, left to right, in the order you use them.
What you will build
Jump straight to any step, or print the list and tick it off beside your Claude tab.
- 1Understand the deal you are making
- 2Install Claude Code
- 3Sign in from inside your repo
- 4Let it read before you let it write
- 5Create a safety branch
- 6Commission the refactor with acceptance criteria
- 7Review the diff like a colleague's PR
- 8Have it open the pull request
- 9Run the full test suite yourself
- 10Ask Claude Code to review its own PR
- 11Merge and watch
If something goes wrong
Everything ready?
Start walkthrough