Claude Code becoming your new peer programmer

30/11/20244 min read
👁️ Loading...

ClaudeCode as your new PR reviewer

For any advocate of Claude Code, you will know how amazing it is without going into the detail about it. I have been using the ProMax subscription of ClaudeCode for a while now and in my own experience it's the best coding assistant on the market as of right now (subject to my own opinion)

Today I will demonstrate to you how Claude Code can become your new PR reviewer, so lets jump right in and waste no time.

1. Start Claude Code in your terminal

First of all lets start Claude Code in a terminal session, you can do this by selecting your terminal of choice and entering claude to start an interactive session.

When you are in your terminal session you can use a forward slash / to see all of the available CLI options you have.

Claude

2. Setup what repository you want to assign the Claude Agent inside of

You can type into the CLI /install-github-app to then go and select your repository you would like to choose.

As I am already in the repositories directory I would like to use in order to setup the PR reviewer I can select to use the current repository.

Claude NOTE: If you have a private repository you may want to install Claude inside GitHub, so if you get something like the below you can hit Enter to continue and then

Claude Once you have hit enter you will then be redirected to a page that looks something like below, please click Install to allow Claude access to GitHub

Claude

When you click install it will then redirect you to login to your GitHub account. Once you have done this then you will have to select the access you would like to give to Claude.

For now we will just select the one repository I have in mind to use. Please be mindful if you have sensitive data in any repositories to make sure and limit access

Once you have done this you should get redirected to the Claude login webpage and then you can finally hit enter on your Claude terminal again once you have finished this.

Claude

3. Setting up your preferred way of PR Reviews

Now that we have setup the Claude access inside of Github we will now decide as to which method we would like to use, there are two methods:

  1. @Claude Code (Tag @claude in issues and PR comments)
  2. Claude Code Review (Automated code review on new PRs)

Claude

For now I have chosen the 2nd option of using Claude Code Review.

Now we will go onto choosing one of the next two methods which is how we would like to setup Claudes authentication, we have two options.

  1. Create a long-lived token with your Claude subscription
  2. Enter a new API key

Again we will go with option 1 to create a long lived token with the Claude subscription.

Claude This will open a UI and ask us yo connect our claude chat account, please select authorise and continue on.

Claude

4. Setting up the pipelines and GitHub Actions Secret

Now we have authorised the Claude account we will get redirected to this. So what we've done here is:

  1. Gotten a PR raised with the GitHub Actions workflows
  2. A GitHub actions secret created for us with the token

Claude handles all of this for us which is just another reason to love Claude Code!

ClaudeSo now that we have the PR raised we can go and merge this. The PR will look something similar to the below image. What's cool about this is we can customise this as much as we want and even add our own prompting which you can read more about here - Claude Code GitHub Actions

Claude

5. Test the Claude Workflow out with a PR

Okay now for the final step, we have gone through and authenticated Claude to our Github and setup the workflows alongside the token secret inside GitHub Actions.

So lets jump into our repository and test this out by tagging Claude to go and review a sample PR:

Conclusion

AI is changing the ways in which we work, everyday there is a new emerging release with all of the biggest AI companies out there wether its Claude, ChatGPT or Gemini etc

There are many many ways in which we can integrate AI into our daily workflows, this example is one of many which I have found effective to date. I plan to share more of my insights into how we as users can leverage Claude Code and I hope this inspires somebody to start integrating AI into their work streams. Happy coding.

Share this post