CodeRabbit: Free AI Code Reviews in CLI (Sponsor)
CodeRabbit CLI is an AI code review tool that runs directly in your terminal. It provides intelligent code analysis, catches issues early, and integrates seamlessly with AI coding agents like Claude Code, Codex CLI, Cursor CLI, and Gemini to ensure your code is production-ready before it ships.
Enables pre-commit reviews of both staged and unstaged changes, creating a multi-layered review process.
Fits into existing Git workflows. Review uncommitted changes, staged files, specific commits, or entire branches without disrupting your current development process.
Reviews specific files, directories, uncommitted changes, staged changes, or entire commits based on your needs.
Supports programming languages including JavaScript, TypeScript, Python, Java, C#, C++, Ruby, Rust, Go, PHP, and more.
Offers free AI code reviews with rate limits so developers can experience senior-level reviews at no cost.
Flags hallucinations, code smells, security issues, and performance problems.
Supports guidelines for other AI generators, AST Grep rules, and path-based instructions.
Motivation
Most engineers waste hours with poor debugging practices. Endless usage of “console.log” and guesswork.
But debugging is where real engineering happens.
It’s not just about killing bugs. It’s about thinking clearly, questioning assumptions, and preventing future defects.
When done right, debugging makes you sharper, faster, and more creative as a developer.
Today I collected my favorite 5 practices to master debugging:
1. Write Clean Bug Reports
Fixing bugs starts with a clean bug report. Yet 99% of developers don’t know how to write one.
But it’s the best way to speed up debugging.
Here’s the difference:
❌ Bad bug report:
I found a bug on UI, the flight booking doesn’t work for one-way route.
✅ The template I use in my team:
When you create a bug report, the goal is simple: make the bug easily reproducible.
2. Prompt AI smartly
Have you ever struggled with AI fixing your code? Most developers just throw endless prompts like “Fix this bug”.
But as the saying goes: Garbage in, garbage out.
If you struggle with AI fixing your code, try this prompt instead:
“Reflect on 5–7 different possible sources of the problem, narrow it down to the 1–2 most likely ones, and add logs to validate the assumptions before moving on to the actual code fix.”
Works like magic.
3. Write a Failing Test for the Bug
My favorite way to fix a bug is to use Test-Driven Development.
If you find a bug, do the following:
Write a failing test to reproduce the bug
Find the bug in the code by debugging your test
Make the failing test pass by fixing the bug
Clean up the code if needed
This practice will force you to pinpoint what exactly the bug is and it’s also easy to tell when you fixed it since you have a passing test.
As a bonus, your bug won’t come back again as you covered with a test.
4. Take a 20-minute Walk
Taking a short walk is one of the most underrated yet powerful ways to fix a bug.
Why?
Because walking is scientifically proven to improve problem-solving and creativity. It resets your brain and lets you see the issue with a fresh perspective.
Magically, this works almost every time. Try it.
5. Use Git Bisect
Git Bisect is a standard GIT tool that helps you find the commit that introduced a bug. It works by performing a binary search between a known good commit and a known bad commit.
Git Bisect requires only two pieces of information before it can start the bug hunt:
A commit where the behavior is definitely good
A commit where the bug is present
Here’s how to use and automate it
Put your test in a script. The script must exit 0 when the bug is absent (good), and non-zero when the bug is present (bad).
Make it executable:
Run bisect with your script:
Git will checkout each candidate commit, run your script, and stop on the first bad commit.
As a result: you have the commit that introduced the bug. Cool isn’t it?
Conclusion
Bugs aren’t obstacles. They’re signals. They show you where to think deeper, where to get sharper, where to grow.
Master debugging, and you won’t just ship cleaner code, but you’ll build the mindset of a true software crafter.