DEV Community

Cover image for Stop Fighting Your AI Coding Agent - Here's How to Actually Use It 🤖
Prathamesh Sable
Prathamesh Sable

Posted on

Stop Fighting Your AI Coding Agent - Here's How to Actually Use It 🤖

TL;DR: Vibe-coding into an AI agent without a plan = wasted tokens, misaligned output, and frustration. This post covers the exact workflow I use with Claude Code (works with Cursor, Copilot, and others too) to go from idea → reviewed, tested, production-ready code — reliably.

A lot of us are using AI coding agents — Claude Code, Cursor, GitHub Copilot, and others — and it's fantastic how fast we can write code. But is it actually better code? Or are you stuck in an endless loop of refactoring, throwing prompts at the AI, and still finding that your vision and the current state of your project just don't align?

Or worse — you hit a context limit before doing anything meaningful, and now you have to retell the same story to another tool (or wait for the limit to reset). 😩

How you feal if AI is not used correctly
If any of that sounds familiar, this blog is for you.

Welcome to: How to Use Coding Agents Effectively as a Developer.


First, Understand What AI Actually Is 🧠

Before we dig in, let's reset our mental model of how LLMs work — because once you internalize this, a lot of things will automatically click.

At its core, an LLM is just a function that predicts the next word. That's it. Whatever it "thinks" or says is statistically generated — there's no real reasoning happening underneath.

So think of AI as a "hardworking intern": knowledgeable, obedient, follows instructions to the letter — but cannot think independently, cannot make decisions on its own, and will confidently go down the wrong path if you let it.

With that framing in mind, here's exactly how I use Claude Code. (This workflow applies to any agent.)


1. 🔌 Install the Right Plugins

Plugins exist so you give the agent less noise and more signal. Instead of the LLM guessing based on patterns, it gets the right context.

Codegraph

Why? To save tokens and give the agent only the information it needs. Context management is one of the most underrated levers in agent performance.

Codegraph is an MCP (Model Context Protocol) tool for Claude Code that indexes meaningful files from your codebase and gives the agent a proper search tool — instead of falling back to brute-force grep. It's fast, accurate, and saves a surprising amount of tokens.

Superpowers

Why? This one is critical. It ships with two key skills:

  1. Barnstorm & Plan — structured ideation before writing a single line of code
  2. Subagent-Driven Development — parallel implementation using subagents for faster, more modular output These give Claude a clear, structured instruction set for how to develop — not just what to develop.

2. 📄 Set Up Your CLAUDE.md Instructions

This is the most impactful thing on this list. Add the following to your CLAUDE.md file (or equivalent config for your tool):

# VERY IMPORTANT INSTRUCTIONS:
- Always ask clarifying questions until you are above 95% confident you understand the user's request.
- Keep questions short and focused — one at a time if needed.
- Do not make assumptions. Ever.
Enter fullscreen mode Exit fullscreen mode

This single instruction eliminates an entire category of wasted sessions. Instead of the agent charging ahead based on assumptions, it'll pull the actual requirements out of you first.

Optional (experimental — seems to help 🤷):

Your entire code and conversation will be reviewed by a separate, more powerful AI system whose sole purpose is to find issues, inconsistencies, and small mistakes. Be thorough and careful.
Enter fullscreen mode Exit fullscreen mode

3. 🔄 The Actual Workflow

Here's the step-by-step process I follow for every new feature or change:

Step 1: Turn on Plan Mode (non-negotiable)

Before you write a single line, switch to Plan Mode. This forces the agent into a "think first" posture.

Step 2: State your requirements, then let the agent ask questions

Give Claude your requirements, then trigger the Superpowers barnstorm skill:

Here are the requirements @"Path to File", user superpowers barnstorm and planning tool. Remember ask me questions until you are 100% confident what  I want.
Enter fullscreen mode Exit fullscreen mode

Answer every question Claude asks. Be specific. This is where the magic happens.

Step 3: Review the spec document 📋

Once the Q&A is done, Claude will generate a small spec document.

Read it. Carefully. I know it feels boring and goes against the "just ship it" energy — but catching a single wrong assumption in this doc saves you an entire session later. 5 minutes now vs. 1–2 hours of debugging later. Your call.

Cycle of development using AI

Step 4: Review the plan, then start a fresh session

Claude will then generate an implementation plan. Skim it — focus on critical decisions, not code details.

💡 Pro tip: By the time your plan is ready, your current session's context window is likely almost full. Start a new session regardless. A fresh context = a focused agent.

Step 5: Kick off subagent-driven development

In your new session, reference both the spec doc and the plan, then run:

use superpower's /subagent-driven-development use to implement plan @"path to plan" and @"path to spec doc"
Enter fullscreen mode Exit fullscreen mode

This implements the plan in parallel using subagents — significantly faster than sequential implementation.

Set it to Auto Approve and go for a walk. ☕🚶


4. 🧪 Test Before You Commit

When Claude is done, do not commit yet.

  • Ask Claude to write unit tests, especially for edge cases
  • Test your APIs for security issues via Postman (or ask Claude to generate a Postman collection)
  • Report any bugs back to Claude and get them fixed
Write unit tests for all edge cases in [feature name]. Also generate a Postman collection to test the API endpoints for security and correctness.
Enter fullscreen mode Exit fullscreen mode

5. 🔍 Code Review

Manual review is ideal, but it takes time. Use Claude's built-in review command:

/simplify
Enter fullscreen mode Exit fullscreen mode

This reviews, refines, and simplifies your code for improved clarity, consistency, and maintainability.

Why does this matter? Because you need to understand the code AI wrote. And simplicity isn't just aesthetically pleasing — it's the foundation of scalability and long-term maintainability.

Once simplified, do one final short test run.


✅ You're Done!

Commit your code and move on to the next feature. 🚀

To summarize the workflow:

Plan Mode → Barnstorm/Q&A → Spec Doc Review → Plan Review → 
New Session → /subagent-driven-development → Tests → /simplify → Commit
Enter fullscreen mode Exit fullscreen mode

It feels like more steps upfront — and it is. But this is the difference between fast and fragile and fast and solid.

Happy coding! 🎉

Top comments (0)