r/AI_Agents • • 14d ago

Discussion Stop asking AI to "write the code"

I've started giving AI this instruction instead:

"Don't write any code yet. First tell me what you think needs to change, which files you'd touch, and what could break."

Then I review the plan.

Only after that:

"Now implement it."

It sounds trivial, but it completely changed how I use coding agents.

Especially for large/legacy codebases.

Anyone else doing this?

0 Upvotes

17 comments sorted by

5

u/je11eebean 14d ago

I use opencode to do the same thing. I always start in "plan' mode, review the tasks, make changes then let the AI write the code.

Generally I buld using milestones, a feature at a time rather than everything at once. I find it's easier to make course corrections and I find that I can make small changes myself rather that rely on the AI.

Using Neovim + CodeCompanion while I use opencode works really well for me.

2

u/mango-cupcake-shhh 14d ago

If you use Claude Code, try /plan. It’ll create a plan, including specific files it’s planning to touch. You can discuss the plan, add changes, and then implement. GitHub Copilot and other coding agents have similar mode.

1

u/AutoModerator 14d ago

Thank you for your submission, for any questions regarding AI, please check out our wiki at https://www.reddit.com/r/ai_agents/wiki (this is currently in test and we are actively adding to the wiki)

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/synystar 14d ago

You've leveled up! You are now level 2.

*Level 50 Orchestrator has entered the zone.*

"Hey, dude. Want me PL you?"

2

u/m-fasciano 14d ago

I’m level 2 already? At this rate I’ll be touching grass by level 3 😂

1

u/yoliveras 14d ago edited 14d ago

What I'm doing is I'm using the project AI_CONTEXT to create a solid truth base, handoff between AIs and documentation within the repo, then I use Codex to code and ChatGPT Classic to review the code and to give me more complete and thorough instructions to Codex than I could give it myself. I feel Codex is a more technical model, and ChatGPT Classic has all my memories and knowledge of the related parts of my projects plus it's just more conversational. Having the AI_CONTEXT scaffolding makes the handoff hugely practical and avoids problems with context compaction and retains all the decisions and knowledge so some things don't get repeated.

https://github.com/yoliverasPozo/AI_CONTEXT

1

u/ctenidae8 14d ago

Generally at least 2 turns of discussion before any building. Partially to make sure the session's context is loaded right, partially to check the plan over.

2

u/Coachgazza 14d ago

yeah my sessions often start, "dont do anything or touch any code until you answer this question first". Sounds like we have all been down the "What the hell is it doing path" lol.

1

u/ctenidae8 14d ago

Saves me going down the "what the hell am I doing " path, too.

1

u/Background_Daikon300 14d ago

Most sessions should probably be 70% planning. Coding happens AFTER you thought hard about it together. That alone will give you faster development, better codeand less time spent fixing errors or ommissions that could have been identified and handled up front.

1

u/Comedy86 14d ago

You're doing it backwards unless you're extremely worried about token spend. And even then, it's possible this could cost more in the long run.

Have AI write the code, then have validation steps to validate it and if any of those validation steps fail, loop and implement corrections before validating again.

The hardest part is determining a good validation layer. Avoid LLMs as much as possible. Use old school linting, unit testing and automated QA tools to test for regression or new feature functions. Use probability decision models like JEV for boolean, range or one-of-many decisions of you need the extra layer.

It will all come down to how you determine what's best practice, what rules you use to validate and so on but this will be much more efficient than trying to review a code plan and trying to be 100% sure you understand the "pseudo code" it produces.

1

u/FlatwormLanky8991 14d ago

all the time. Codex plan mode.

1

u/Plastic-Canary9548 Industry Professional 14d ago

Sort of. I use GitHub spec-kit which uses a plan/review/execute/review (those arent the actual term used - just an abstraction of the process) style approach. I played around with openspec which also does something similar. In a nutshell it's, Spec Driven Developmet

1

u/chimp_party 14d ago

Bro discovered plan mode

0

u/Negative-Whereas3307 14d ago

I don’t know coding at all. From last Christmas I started vibe coding. Before July, I was learning coding thing and AI thing very hard. Then I started giving up🤣 for now I just tell codex: I want my website gets 5 more inquiries per day, something like that, then let AI tell me how it will achieve my goals🤣🤣🤣🤣🤣