How I use Claude Code
Since ChatGPT 3.5, I have been alternating between ChatGPT, Perplexity, Grok, and Claude. Since the summer, I have been using Claude because I wanted access to Claude Code.
Recently, I tried Claude Code in a slightly larger project, and I was surprised how well it performs. The project is a .NET C# application, built with Blazor and Entity Framework. Software projects are rarely especially unique, and a lot of coding isn't very novel. The same applies to this code base – it looks like .NET code bases usually do. I think that characteristic contributes to Claude Code's efficacy.
When I write instructions to Claude Code, I write as if it was to a junior colleague. I have worked with many developers, and the way I write to Claude Code is the same way I would have written a Jira ticket to a junior developer in the past. I like to think about what I want my solution to look like, and then give clear steps to achieve that. I think that strategy works very well and I get satisfactory results.
Here I want to share an example of a prompt I gave Claude Code (with some spelling errors that I didn't bother fixing):
I want to implement so that it in the HANS project is possible for handling officers (handläggare) to mark messages as
handled. Messages are in the Dokument table, it's one of the types. Since it's only messages that should be possible to mark as
handled, I want to create a separate table for this. Please do these things:
- Create a new table called DocumentHandledStatus. Look at ConversationThread.cs in Data/Entities as inspiration. I want it to
referes to a DocumentInstanceId as well.
- Create a new service like ConversationThreadCreator.cs as inspiration. I want it to mark a document as handled. I also want to
be able to remove the handled status of a document.
- When a document gets saved with status Inskickad, please call the service to remove its handled status. You can add this logic
to UppdateraBadffDokumentStrategy.cs and UppdateraDansDokumentStrategy.cs, so the call happens from there. Please look at how
other actions happen depending on the document's status.
- In the HANS project, in Projekt/Visa.razor, please update the documents table so that it's possible through the Funktionsmeny
to mark messages as handled. This needs to trigger the service. Display an unhandled message with a different background color
in the table. You can see in the Etjanst project in its Projekt/Visa.razor file how documents get a different background when
it's unread (EjLäst). Please use the same style class when a message is unhandled in HANS.
- When fetching the document list to HANS in Projekt/Visa.razor, please also include its handled status. Do a join with the new
table.
- In HANS Index.razor page, there's a datagrid with the ID "inkomnaMeddelanden". Please also add a column to that table where
it's possible to toggle the handled status of the message.As you can understand from this example, I had already thought through the problem and come up with a solution. I know the code base and knew where changes needed to be made. I was able to write these instructions, leave the computer to eat breakfast, come back 30 minutes later and have a solution 90% done. Then it's just up to me to test it, verify that it looks like I want it, and do some minor tweaks.
What impresses me by this, is that I am only paying $20/month, and the AI is essentially doing what a junior developer would have done for at least 100 times as much in compensation. Sure, I am running out of credits from time to time, it's far from always that I use Claude Code, it doesn't take its own initiatives, etc. But still, the amount of value I get out of an AI far exceeds the price I am paying for it.
The type of junior developer that Claude Code replaces is the one who cannot think for himself and is unable to come up with good solutions. What I did with my example above was essentially the difficult part – know the code base and think how to implement a new feature. What remains for the AI then is simply the meticulous task of actually writing the code and all boilerplate around it. As in most cases, very little code is actual business rules/logic, and most is just repetitive code that has been seen thousands of times before to shuffle data around in the application.
I still think it's important to stay sharp though. You need to continue to code yourself to keep and develop your skills. You need to think, be skeptical, research if there are better solutions, follow along with changes in your programming language, question if there are better ways to solve problems in, and so on. But when it comes to writing repetitive, boring code – it's perfectly something that can be offloaded on an AI.