DEV Community

Learn AI Resource
Learn AI Resource

Posted on • Originally published at learnairesource.com

Stop Using 6 Chrome Tabs for Code Reviews—Do It in Your Terminal

You know that moment when you're reviewing a PR and you need to:

  • Check the GitHub diff (tab 1)
  • Search stack overflow for the pattern (tab 2)
  • Open the docs (tab 3)
  • Look at existing similar code (tab 4)
  • Google the random error (tab 5)
  • Have slack open because someone inevitably messages you (tab 6)

Yeah. Let's fix that.

The Old Way Sucks

Browser-based code review tools are slow for one simple reason: they're not built for developers who think in terminal commands. You're constantly switching context—reaching for the mouse, squinting at small diffs, waiting for pages to load.

What if your code review tool was just... bash?

Enter Claude in the Terminal

There's a trick that changed how I review code. Instead of opening GitHub, I pipe the diff through Claude (or any LLM) and get instant feedback with actual reasoning.

Here's the real command I use:

git diff origin/main..HEAD | curl https://api.anthropic.com/v1/messages \\
  -H "x-api-key: $ANTHROPIC_API_KEY" \\
  -H "content-type: application/json" \\
  -d @- | jq '.content[0].text'
Enter fullscreen mode Exit fullscreen mode

Drop that in a function, add some formatting, and you get structural feedback in seconds instead of 10 minutes of alt-tabbing.

What You Actually Get

When I used this on a recent refactor, it caught:

  • A query that would n+1 on user load (I missed it)
  • A memory leak in the cleanup function (would've been a production bug)
  • Three places where error handling was inconsistent
  • A security issue with unvalidated user input

Took Claude 3 seconds. I would've spent 15 minutes finding two of those.

Real Example: Your Actual Code

Let's say your coworker just pushed this and asked you to review:

function fetchUserData(userId) {
  return db.query(`SELECT * FROM users WHERE id = ${userId}`)
    .then(data => JSON.stringify(data))
    .catch(err => err.message)
}
Enter fullscreen mode Exit fullscreen mode

Running it through the pipeline:

Critical issue: SQL injection vulnerability - userId is interpolated directly
Performance issue: Serializing with JSON.stringify adds latency
Error handling: catching errors as strings means you lose stack traces
Better approach: Use parameterized queries, let DB handle serialization
Enter fullscreen mode Exit fullscreen mode

You can also ask it to explain the fix, not just flag problems. Takes 30 seconds for output that would take you 5 minutes to manually review.

The Speed Advantage

  • GitHub UI: Load PR → wait for page → read → switch tabs for context → 8 minutes
  • Terminal review: pipe diff → JSON response → 20 seconds

Not hyperbole. I timed it.

But Won't This Miss Context?

Sometimes. The LLM doesn't know your specific codebase patterns without telling it. So add context:

cat ARCHITECTURE.md | cat - <(git diff origin/main) | send_to_claude
Enter fullscreen mode Exit fullscreen mode

Now it understands your patterns first. Way better reviews.

Two Ways to Do This

Option 1: Use existing tools

  • aider - Claude-powered pair programmer, includes review mode
  • git-review - wrapper scripts for automated review

Option 2: DIY (2 hours of work)

  • Write a bash function that pipes diffs to Claude's API
  • Add error handling and caching (so you don't hit rate limits)
  • Alias it to review and call it with review HEAD~5

I went with DIY because my team has specific standards I wanted Claude to enforce.

The Real Value

It's not that the AI is smarter than you. It's that it's consistent and fast. You're not tired after reviewing your 50th PR that day. You're not missing obvious stuff because you've been context-switching for 6 hours.

And the feedback is usually just detailed enough without being overwhelming. Better than some humans I've worked with, not gonna lie.

What's Next

The next level is semantic analysis—not just "this looks wrong" but "this contradicts the pattern you established in module-x". That's hard without buil them in, actually works.

For now, if you're drowning in PRs, try piping one through Claude. Spend 10 minutes setting it up. You'll save that back in a single review.


Want to stay sharp on AI tools and productivity tricks? Check out LearnAI Weekly—real strategies from people actually using this stuff, not hype.

Top comments (0)