Ai Coding Tools

How to Write Cleaner Code with AI Tools in Just 2 Hours

By BTW Team4 min read

Comparing tools? See the AI tools tested on the show.

In short

A step-by-step guide for developers on utilizing AI tools to clean up and optimize their coding practices effectively in under 2 hours.

In the fast-paced world of coding, writing clean code is not just a best practice; it's essential for maintaining and scaling projects effectively. But let’s face it—between deadlines and feature requests, it can be tough to prioritize clean coding practices. That’s where AI tools can come in handy. In this article, I’ll walk you through how to leverage these tools to improve your code quality in just 2 hours.

Prerequisites: What You’ll Need

Before diving in, here’s what you’ll want to have ready:

  • A code editor (VS Code, JetBrains, etc.)
  • Basic coding knowledge (Python, JavaScript, etc.)
  • An account with a couple of AI tools (see our tool list below)

Step 1: Choose Your AI Tools (30 minutes)

Here’s a list of AI tools that can help you write cleaner code. Each tool has its strengths, limitations, and pricing models.

| Tool Name | What It Does | Pricing | Best For | Limitations | Our Take | |------------------|------------------------------------|-----------------------------|---------------------------------|----------------------------------|-------------------------------| | GitHub Copilot | AI-powered code suggestions | $10/mo, free trial available| Quick code snippets | Limited to popular languages | We use this for rapid prototyping. | | CodeGuru | Code reviews and performance insights| $19/user/month | Java and Python projects | Limited to AWS ecosystem | We don’t use this due to AWS lock-in. | | Tabnine | Code completion suggestions | Free tier + $12/mo pro | Multiple languages | Some suggestions can be off-base | We find it helpful for JavaScript. | | SonarLint | Real-time code quality feedback | Free | Static code analysis | Limited to IDE integrations | We use this for ongoing projects. | | DeepCode | AI-driven code review | Free tier + $12/mo pro | Security vulnerabilities | Sometimes misses edge cases | We don’t use it as much anymore. | | ReSharper | Code analysis and refactoring tools| $149/year | .NET languages | Pricey for solo devs | We stopped using it due to cost. | | Codacy | Automated code reviews | Free tier + $15/user/month | Continuous integration | Can be complex to set up | We use this for CI/CD pipelines. | | Kite | AI-powered coding assistant | Free | Python and JavaScript | Limited language support | We love it for Python projects. | | JSHint | JavaScript code quality tool | Free | JavaScript only | Doesn’t catch all errors | We don’t use it anymore. | | ESLint | Linting tool for JavaScript | Free | JavaScript and TypeScript | Requires configuration | We use this religiously. |

What We Actually Use

In our stack, we primarily rely on GitHub Copilot for initial coding, SonarLint for ongoing quality checks, and ESLint for JavaScript projects. This combination has worked wonders for us, especially when shipping products quickly while keeping the code clean.

Step 2: Set Up Your Environment (15 minutes)

  1. Install your chosen tools: Most of these tools have straightforward installation processes. Follow the documentation for each tool to integrate them into your code editor.

  2. Configure the settings: Spend a few minutes adjusting settings based on your coding style and preferences. For instance, in ESLint, you can set rules that enforce your code style.

Step 3: Write Clean Code with AI Assistance (45 minutes)

Now that you have your tools set up, it’s time to write some code. Here’s a simple workflow:

  1. Start with a clean slate: Create a new project or file.

  2. Code with AI suggestions: As you write, pay attention to the suggestions provided by GitHub Copilot or Tabnine. They can often help you with best practices you might overlook.

  3. Run real-time checks: Use SonarLint to check for code quality issues as you code. It will flag potential problems immediately, allowing you to fix them on the spot.

  4. Refactor with AI tools: Once you have your initial code, use tools like DeepCode or Codacy for a deeper analysis. They can help you identify areas for optimization you might not catch on your own.

Step 4: Troubleshooting Common Issues (15 minutes)

Even with AI, you may run into issues. Here are some common problems and solutions:

  • AI suggestions are irrelevant: If you find the suggestions from GitHub Copilot are off, try retraining it with more context about what you’re trying to achieve.
  • Static analysis tools flag too many issues: Adjust the configuration settings to be less strict if you feel overwhelmed by warnings.
  • Integration issues: If tools like Codacy aren’t integrating well with your CI/CD pipeline, check the documentation or community forums for troubleshooting advice.

What’s Next?

Now that you’ve cleaned up your code, consider implementing a continuous integration system to maintain code quality over time. Tools like CircleCI or GitHub Actions can help automate this process.

Conclusion: Start Here

If you’re looking to write cleaner code quickly, start by integrating GitHub Copilot and SonarLint into your workflow. Spend just a couple of hours getting familiar with these tools, and you’ll find that writing clean code becomes a lot easier.

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools
Ai Coding Tools

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them)

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them) In the everevolving landscape of AI coding tools, it's easy to get swept up in the hype. As indie hackers and s

Nov 30, 20263 min read
Ai Coding Tools

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026 In 2026, the landscape for indie hackers and solo founders has evolved significantly, especially with the advent

Nov 26, 20264 min read
Ai Coding Tools

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026 If you’re a developer stuck maintaining legacy code, you know the frustration. It’s like navigating a maze blindfolde

Nov 23, 20264 min read
Ai Coding Tools

10 AI Coding Tools That Will Save You Hours of Debugging in 2026

10 AI Coding Tools That Will Save You Hours of Debugging in 2026 Debugging can feel like a neverending cycle of frustration. Whether you're a solo founder or an indie hacker, spend

Nov 18, 20265 min read
Ai Coding Tools

10 Common Mistakes When Using AI Coding Tools for MVP Development

10 Common Mistakes When Using AI Coding Tools for MVP Development As a founder in 2026, you’re likely aware that AI coding tools can significantly speed up the MVP development proc

Nov 16, 20264 min read
Ai Coding Tools

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026 As a beginner developer, you’ve probably come across a ton of buzz surrounding AI coding tools. But with all the hyp

Nov 12, 20263 min read