One week with Claude Code on a legacy codebase

If anything, I welcome our new AI overlords. They bring joy to my life of a software engineer.

Claude Code is great, but with some asterisks.

Git and pull requests

Claude is amazing with terminal, and that includes Git. Combined with the GitHub CLI gh tool, Claude knows how to check for recent changes, write a great commit message, push changes, and if that fails, rebase your changes. Then, create a pull request while respecting the PR template, add a relevant description, and open it for review.

It can also review a PR, whether it’s from you or someone else. All from the terminal.

On a particular occasion, I’ve realised there’s way too much in a single PR - and it would be nice to split it into 2 separate ones. Best practices and all, keep your changes granular. A straightforward task, you just create a new branch, cherry-pick some commits from another one, create a new PR with a description, update the other branch and PR to exclude the picked commits.

Claude did it in a minute, on its own.

Claude as a coding partner

Claude tries to be a software engineer. But at the moment it is more of a talented junior to mid-level engineer, who is highly talented in some parts ot tech, but mostly never worked in a team, mostly built greenfield projects, and keeps forgetting the larger picture.

It is also highly enthusiastic, semi-autonomous, and will never stop until a problem is solved, or your account runs out of money, whichever is soonest.

Money and tokens

Each question to Claude will cost money. At the moment, it offers 2 models of choice - Opus and Sonnet. Opus is supposedly a more advanced model in terms of reasoning, but it is currently one of the most expensive models on the market, with pricing at $15 per one million of tokens. Sonnet is 5 times cheaper, but even that is more expensive than the current competition from the likes of Google.

A full day of me coding a React frontend would usually end up costing $$10-15 with a Sonnet model. Switching to Opus would probably get the cost to around $100 / day.

This is, of course, when using API pricing. Anthropic also offers subscription tiers, all of which come with usage caps. The most expensive tier of $200 / month will allow about 20 days of running Claude Code around the clock.

Cost considerations are a bigger concern when running with an API based pricing. Claude can easily go into a rabbit hole, burn through a lot of tokens and still not solve the actual problem. Same as with human engineers.

Frontend development

There’s probably a more elegant way of doing this - and I bet there’s an MCP for Figma somewhere. I needed a newly designed component to be implemented in our legacy frontend app. The component is a static pop-up that should show up under a particular set of conditions.

I took a screenshot from Figma and asked Claude to do it.

It did an amazing job. Recognised all the text for the copy, put it into the correct place for localised text constants. Created a new React component for the pop-up from scratch, while following the coding conventions of similar pre-existing pop-ups. Used correct styling conventions and colours from the colour library. Generated a bunch of unit tests for the component. This is something that would easily take a day of my work, from zero to demoable functionality in about 5 minutes.

Rabbit holes

I was vibe coding a Slack bot on top of the Slack Deno SDK, and Claude went into a spectacular rabbit hole trying to get it working. The issue ended up being a legitimate bug of Deno Starter Template related to dependency handling. However, Claude was not able to figure this out at all and kept on digging into Deno itself in a massive, unproductive loop.

I was sort of expecting it to almost get mad for going in circles, something that a human engineer would almost certainly do at some point. But no - after a couple of rounds, it started to dig deeper into the Deno itself and package management, which still wasn’t helping at all and was burning through the tokens. Luckily, this was all in a supervised mode, and I’d imagine I could’ve easily spent massive amounts of money otherwise without really solving anything.

One thing that Claude is missing at the moment is the ability to check for more tricky issues and solutions on the Internet to get itself unstuck.

Great at sprints, bad at marathons

If I had to summarise the strengths of Claude Code, it would be this. You give it a set of precise instructions, something you’d give yourself or another teammate on the same project. You might have to remind it to adhere to pre-existing coding conventions and styles. Or use existing constants and components, instead of making new ones. After that, it would usually do a great job at initial implementation. You’d review it, issue a few more suggestions for improvements, and it would arrive at a more or less workable pull request.

After that, you can ask GitHub Copilot to review this PR. Let them AIs work together.

For longer runs, Claude will be losing context, which is something we humans seem to be still better at. Once it runs out of the context quota, it will perform compacting, which will also consume some tokens. Having Claude.MD helps with maintaining context, but it will also cost you tokens. There is a middle ground somewhere to have a small but useful enough Claude.MD.

It will suggest running rm –rf

The first time it suggested running rm --rf on a directory to clean up files, I had to double-check the command multiple times before letting it do it.

Is there a chance for Claude to run destructive commands on your machine? I’d say very much so. Should you run it in a Docker container just in case? Possibly - depending on the type of work you do.

Either way, it is worth having a backup, and also pushing all important code changes to remote often.

It is highly addictive

You can indefinitely watch fire burn and others doing work.

It is quite fascinating to watch Claude Code work, while also feeling you can interject at any moment. Traditionally, as an engineer, you’d code for a bit, then let it compile, maybe run some tests. Maybe you get stuck and will need a cup of tea. Maybe you’d need expert advice, and your colleague is in a meeting right now or busy with another task.

Claude Code removes lots of blockers and keeps you engaged at all times. And it needs your engagement to keep going in the right direction.

It also allows you to quickly address tech debt. Something that would generally be good to have, but often would require a lot of coding and time. Quick refactor? Move all magical values into constants? Split a module? Add more tests? All of these are trivial now, thanks to Claude.

This means on a good day, you will end up actually coding and building software for much longer stretches of time. A 10x engineer, you say?