Claude Code for Product Designers
Lesson 25 of 49, 0 of 49 lessons completed
Sign in
Watch on YouTubePlay

Plays from YouTube. Google's privacy policy (opens in a new tab) applies.

Up next

2.11 Three ways to merge

Next lesson in 8 s

2.10 A second look before merging

Adam explains what code review is and why it's worth doing even on a solo project, then installs Anthropic's code-review plugin and runs it on his pull request in a fresh sub-session.

What you'll learn

  1. Code review: someone with a fresh perspective checks the changes before merging; fixes and reviews repeat until everyone's happy.
  2. Solo hobby projects often skip PRs; for a project you care about, an occasional PR and review keeps it future-proof, and with engineers it's standard.
  3. /simplify is for daily clean-up while you work; code review is made for PRs.
  4. Anthropic's code-review plugin shares the built-in's name; it spawns four sub-agents, validates each issue, and can comment on the GitHub PR.
  5. AI reviews produce false positives, so findings need validating before acting on them.
  6. Run the review in a separate sub-session for fresh eyes; tell the main session not to brief it, so you choose the skill.
  7. Restart the app right after installing a plugin.
  8. With findings: post a summary on the PR, have the main session re-validate them, fix, commit and push.

Chapters

  1. 00:00What code review is
  2. 01:25Pull requests on solo projects
  3. 02:39Installing Anthropic's code-review plugin
  4. 04:26A fresh sub-session for review
  5. 06:24How the review checks findings
  6. 07:39What to do with findings
  1. 00:00Okay, well, congratulations. Our first PR is raised, but it is not merged yet, meaning nobody visiting our live deployment on Vercel is going to be able to access that
  2. 00:13my bookings view. Before we can merge this PR, it is actually a good idea to make sure that the code we are trying to merge with the main branch
  3. 00:23is not like is as clean as possible.
  4. 00:26It has no bugs, it has nothing that would later surprise us.
  5. 00:30Now, a process that takes care of this is called code review.
  6. 00:35So typically in the past, what would happen after a PR has been merged, you would like ask for a fellow engineer on your team to review this PR, and
  7. 00:45that fellow engineer would open this up with a fresh perspective and a fresh pair of eyes.
  8. 00:50It would look through the changes, it would look through the code, it would make comments on the lines that look suspicious or things that this engineer has found, you
  9. 00:59know, for some reason something to reconsider.
  10. 01:03It would finish the code review, and then you as a engineer raising this PR, you would have to go and make the fixes, and then you know, the process
  11. 01:10repeats until everyone is happy.
  12. 01:11Only then the PR can be merged.
  13. 01:14Nowadays, however, in the age of of AI, yes, we do have many AI agents automating this process.
  14. 01:22And we [snorts] are going to see in this video how this can look like with Glot.
  15. 01:27Before I get any further, one important thing to clarify.
  16. 01:31This whole process of raising PRs and then doing a code review is not necessarily something you would see most solo developers or engineers doing on their own like solo
  17. 01:41hobby projects. It's much more typical to just keep using commits, eventually like moving on to using branches, but raising PRs is really a thing that is typically associated with
  18. 01:55you know, bigger code bases.
  19. 01:58However, if you work on and you really intend on, you know, developing it for the next weeks or months and you really have high hopes about it, you know,
  20. 02:09raising a PR occasionally and then going through the code review is a really nice way to make sure your codebase is as, you know, as future-proof as possible, really.
  21. 02:21And also the purpose of this entire video course is to not just work like engineer, but also sometimes to work with engineers.
  22. 02:29And when we work with engineers, we're definitely going to be well, handling code reviews.
  23. 02:35So with that, let me switch back to Claude.
  24. 02:39There is actually a built-in tool within Claude Code that we could use.
  25. 02:44It's just called code review, similarly to how Simplify works, but this one is really created more with PRs in mind, whereas the Simplify skill which we used a couple
  26. 02:55of videos ago is more about like doing that you know, daily cleanup when you are still sort of in the trenches.
  27. 03:04But there is actually something else that I would like to use.
  28. 03:07It's a plugin also from Anthropic and confusingly it has the exact same name.
  29. 03:12It's called code review.
  30. 03:14The reason I like this plugin a little bit more because it like this process is just a little bit more elaborate.
  31. 03:21It will also involve spawning sub-agents.
  32. 03:24It's going to then, you know, re-review all of the findings and all of all of the claims.
  33. 03:30It's going to validate whether these are true or perhaps these are false positives and then it's going to post a comment on your behalf on on a GitHub PR,
  34. 03:40which is pretty nice.
  35. 03:42Let's go ahead and add this PR here.
  36. 03:44I'm sorry, add this plugin.
  37. 03:47And let's give it a second.
  38. 03:50Perfect. Now learning from my past mistakes, I'm just going to go ahead and restart the Claude Code application right away just to make sure everything works okay.
  39. 04:03Okay, and now uh going back to this session, if I now type in the slash command and go code review, code review, we can see again I I I
  40. 04:12mentioned it's a little bit uh it's it's a bit complicated thanks to Anthropic, but we now have this new entry here which is code review code review and this
  41. 04:21is the plugin that we want to use here, okay?
  42. 04:24Uh now I'm not going to run this command here in this chat.
  43. 04:28Why? Because the whole purpose of doing a code review is to get a fresh pair of eyes.
  44. 04:33If I now were to ask the exact same agent to follow the process, even though there are sub agents involved, I don't think that would be really the most
  45. 04:41optimal way to do this.
  46. 04:43So but I would still like to for this agent to be kept in the loop, so I'm going to do the exact same trick as we did a couple
  47. 04:49of videos ago. I'm going to ask it to create a sub session for me uh so that I can handle the code review, okay?
  48. 04:56[snorts] So I'm going to head over here.
  49. 04:59Uh Claude, thank you.
  50. 05:00Can you uh set up a new sub session for me so that I can handle code review uh for this PR which we just raised?
  51. 05:08Um don't give it any comments.
  52. 05:10Let me handle the rest.
  53. 05:14Okay, the last part is important because knowing Claude, it would probably, you know, uh set up the entire prompt and you know let the sub agent or sub session
  54. 05:24running uh and we want to be the ones making sure that we use the right skill.
  55. 05:30Um so let's hit send and um let's wait around and see for that sub session to appear in our left hand sidebar.
  56. 05:38Okay, perfect. We have that sub session.
  57. 05:42Seems like it's been already briefed on which PR this is uh about, of course.
  58. 05:48Not that there are any other PRs it could be possibly about in this repo.
  59. 05:53Uh and uh this is the place in which I'm going to You know what?
  60. 05:57I'm going to actually increase the effort here to high and uh I'm going to run the code review code review.
  61. 06:05Code review. Okay, let's see.
  62. 06:07Code review. Code review.
  63. 06:10It seems like it's still going to show up as a single code review, but I I'm going to trust it's the the plugin version.
  64. 06:16Yeah, it is a plugin version.
  65. 06:17Again, um a bit complicated on the anthropic part.
  66. 06:21I hope they are going to um fix it eventually.
  67. 06:25And um yeah, this is basically this is loaded a skill uh which comes with very elaborate instructions on how to proceed.
  68. 06:32Um the first step is to confirm that the PR this is about is still open and if whether it still needs a review, then it's going to look for
  69. 06:40the CLAUDE.md files, which is exactly why we wanted to keep that CLAUDE.md file up to date with the one of the previous videos.
  70. 06:48Um it's going to summarize PR changes and then it's going to spawn um um like sub agents four to be exact.
  71. 06:55So it's similar as with the simplify.
  72. 06:58And then, you know, this is the important part.
  73. 07:00It's going to validate each flagged issue.
  74. 07:02And this is exactly why we are using this plugin version of the code review over the one that come that Claude Code comes pre-installed with uh because what the
  75. 07:10pre-installed version would do is it would just, you know, spit out the box without really validating them.
  76. 07:18Um and this is not really something that we want.
  77. 07:20With AI, there are plenty of false positives, so you would really need to be careful about executing or like acting on claims which are sometimes just straight up false.
  78. 07:32Um okay, we have four sub agents working here.
  79. 07:36Let uh let's give them some time and let's see what kind of findings we are going to get.
  80. 07:44Okay, and we're finished.
  81. 07:45Um and guess what?
  82. 07:47Seems like I'm uh lucky today.
  83. 07:50So no issues have been found.
  84. 07:52Um well, according to these cloud uh sub agents, uh all four reviewers each went through the PR on their own and none of them flagged anything, so there was
  85. 08:03nothing to double check.
  86. 08:05Okay, yeah, that honestly, I don't think that has ever happened to me.
  87. 08:09So here's how you can proceed in case your PR turns out with some findings.
  88. 08:17So what I would do later is I would I would first of all ask Claude to post a summary on the GitHub PR page.
  89. 08:26And what this is going to do is going to create or add a new comment here on your behalf with your comments.
  90. 08:32And then I would go back to the main reviewer and I would ask it to basically revalidate these claims.
  91. 08:40And if that reviewer or if that sub agent thinks or if that agent thinks this is something we should we should fix, then I would ask it to do
  92. 08:48the fixes and then commit and push this work.
  93. 08:53And once the work is committed and pushed, we are ready for the final step, which is merging the PR.
  94. 09:02And this is actually something we are going to tackle in the next video.
  95. 09:06So with that, I'm going to see you in the next one.
  96. 09:08Thank you.

The cheat sheet is for signed-in viewers. Inside: the lesson's prompts ready to reuse, the commands and shortcuts, useful links and what to watch out for.

Sign in to get the cheat sheet

Loading the cheat sheet…