There's a blog post making the rounds right now about separating planning from execution when using Claude Code. It resonated with me because I've been doing something similar — and I think the principle applies way beyond any single tool.
Here's the AI coding workflow I've landed on after months of daily AI-assisted coding — and it's the only AI workflow automation pattern that consistently works.
Why Most AI Workflow Automation Fails
Most developers use AI coding tools like a magic 8-ball. Type a vague request, get a vague result, then spend 20 minutes fixing what it got wrong.
The issue isn't the model. It's that you're asking it to do two very different jobs at the same time:
- Figure out what needs to happen (planning)
- Write the actual code (execution)
These require different kinds of thinking. When you mash them together, you get code that's structurally okay but solves the wrong problem, or code that solves the right problem but in a way that doesn't fit your codebase.
This is why most attempts at AI workflow automation fall flat — people automate the wrong step.
How to Build an AI Coding Workflow That Works
Before I touch any code, I write out what I want in plain English. Not a prompt — a spec. Something like:
"Add rate limiting to the /api/search endpoint. Use a sliding window counter stored in Redis. Limit: 100 requests per minute per API key. Return 429 with a Retry-After header when exceeded. Add middleware so other endpoints can use the same pattern."
That's it. No code. No implementation details. Just a clear statement of what the result should look like.
Then I feed this to the AI as the planning step: "Break this down into subtasks. Don't write code yet."
The model comes back with a task list. I review it, adjust priorities, remove things it hallucinated, add things it missed. Takes about 2 minutes.
Then I hand each subtask to the AI for execution, one at a time.
Why Separating Planning from Execution Works
Three reasons:
1. You catch bad assumptions early. If the AI's plan includes "create a new Redis connection for each request," you spot that in the planning phase and correct it before any code exists. Way cheaper than debugging it later.
2. You maintain architectural control. The AI writes code within the boundaries you set, not whatever it thinks is clever. Your codebase stays consistent.
3. The code quality goes way up. Smaller, well-scoped tasks produce better code than "build me a feature." It's the same reason we break work into tickets for human engineers.
My AI Workflow Automation Setup (Step by Step)
Here's what a typical session looks like:
- I write the spec — 2-5 sentences describing the end state
- AI creates the plan — ordered subtask list with file paths
- I review and adjust — usually takes 2 minutes, sometimes catches major issues
- AI executes each subtask — I review each output before moving on
- I handle the integration — connecting the pieces, running tests, verifying behavior
Steps 1 and 3 are where I add the most value. Steps 2 and 4 are where AI adds the most value. Step 5 is shared.
This workflow works with any AI coding tool — Claude Code, Cursor, GitHub Copilot, or even ChatGPT with copy-paste. The principle is tool-agnostic.
The Uncomfortable Truth About AI Coding Speed
This workflow is slower than "just ask the AI to build it." At least, it feels slower. But when I tracked my actual time over a month, the planning-first approach was about 40% faster end-to-end because I almost never had to throw away large chunks of AI-generated code and start over.
The biggest time sink in AI-assisted coding isn't generation — it's rework. Planning eliminates most rework.
What AI Workflow Automation Can't Replace
Not everything belongs in this workflow:
- Bug investigation — I still read stack traces and reproduce issues myself. AI is great at suggesting fixes, terrible at understanding why something broke in your specific environment.
- Architecture decisions — AI can propose options, but I decide. It doesn't know the team's priorities or the product roadmap.
- Code review — I review everything the AI writes. Every line. Not because I don't trust it, but because I need to understand it for when it breaks at 2am.
Try This AI Coding Workflow Tomorrow
If you're currently using AI as a code generator, try one thing tomorrow: before your next feature, write down what you want in 3 sentences. Ask the AI to make a plan. Review the plan. Then start coding.
You'll probably be surprised how much better the output is.
Top comments (0)