How To Code With A.I
AI-assisted coding has fundamentally changed software development workflows, but success requires treating AI as a tool for engineers who already understand ...
By Sean WeldonAI-Assisted Coding: A Planning-First Engineering Workflow
TL;DR
AI coding tools like Cursor have transformed software development by accelerating work engineers already know how to do, not replacing coding knowledge. Success requires a planning-first workflow using expensive models like Claude Opus for planning and cheap models like Composer for implementation, combined with verification harnesses that let models check their own work. Treat code as disposable and prompts as the maintained artifact.
Key Takeaways
AI coding assistants require existing programming expertise to be effective—they accelerate work you already understand rather than teaching fundamentals, with typical workflows producing 4-5 discarded attempts for every successful merge.
Strategic model selection keeps costs at $20/month despite heavy usage—expensive smart models (Opus, GPT-4) handle planning while cheap fast models (Composer, Groq) execute implementations, optimizing both quality and cost.
Verification harnesses improve model performance more than using smarter models—providing tools like
bun run tscfor type-checking and dry run modes for faster testing tightens feedback loops and dramatically increases output quality.Git work trees enable parallel model comparison—multiple AI models can work on identical tasks simultaneously in separate directories, revealing which models excel at specific problem types through direct output comparison.
Concrete code examples outperform documentation for context—cloning dependency repositories as subtrees and providing test files gives models better patterns to follow than traditional documentation or MCP servers.
What Does AI-Assisted Coding Actually Mean?
AI-assisted coding refers to using AI models to accelerate software development tasks that engineers already know how to accomplish. This approach fundamentally differs from "vibe coding" or attempting to build applications without understanding the underlying code. Engineers must evaluate outputs, debug issues, and architect solutions—skills that require existing programming expertise.
The workflow operates on a simple economic principle: code generation has become cheap enough to treat as disposable. Engineers should discard failed attempts entirely and regenerate from scratch rather than fixing problematic implementations. Cursor's $20/month tier provides sufficient capacity for heavy usage when developers strategically select models based on task complexity.
How Does the Planning-First Workflow Function?
Planning-first development separates the thinking phase from the execution phase using different AI models for each stage. Smart models like Claude Opus or GPT-4 create detailed implementation plans that humans review and edit before any code generation begins. Once engineers validate these plans, faster models like Composer handle the actual implementation work.
The prompt or plan serves as the maintained artifact between attempts, not the generated code itself. For every successful merge, developers typically produce 4-5 discarded attempts with iterative plan refinements. This disposable approach prevents fixation on flawed implementations and encourages rapid experimentation.
Engineers should think of the plan as version-controlled documentation. When an implementation fails, developers return to the plan, adjust requirements or constraints, and regenerate completely rather than attempting incremental fixes to broken code.
What Are Git Work Trees and Why Do They Matter?
Git work trees allow multiple branches to exist in different directories simultaneously on the same machine. This feature enables running multiple AI models on identical tasks in parallel for direct output comparison. A custom setup script automatically copies .env files and runs installation commands like bun install for each new work tree.
Developers can launch Composer, Opus, and Gemini simultaneously on the same problem, then compare results to identify which models excel at specific task types. Work trees run locally but remain isolated from the main working directory, preventing conflicts and enabling safe experimentation.
The parallel approach reveals model strengths quickly. One model might generate cleaner type definitions while another produces better error handling. Engineers can cherry-pick the best approaches from multiple attempts rather than committing to a single model's output.
How Do Verification Harnesses Improve AI Output?
Verification harnesses provide AI models with tools to check their own work, dramatically improving output quality. Tightening the feedback loop matters more than using smarter models. Simple validation commands like bun run tsc for TypeScript type-checking catch unsafe code before execution.
Projects with long-running test suites benefit enormously from dry run modes. One benchmark project requires 6-8 hours for full suite execution, making rapid iteration impossible without faster validation alternatives. Creating abbreviated test modes enables models to verify correctness in minutes instead of hours.
A 50-50 ratio of actual requirements to verification instructions in prompts produces acceptable results. Engineers should explicitly list validation commands models should run, call out specific observed mistakes to prevent recurrence, and specify exact package versions to avoid outdated implementations. Tests in existing repositories serve as examples that improve model behavior automatically.
Why Do Code Examples Outperform Documentation?
Concrete code examples provide models with better context than traditional documentation or API references. Cloning dependency repositories like Effect as subtrees gives models access to actual implementation patterns rather than abstract descriptions. Test files prove particularly valuable because they contain concrete usage examples.
Larger codebases can actually improve agent performance due to more pattern examples available for the model to reference. Writing example files showing desired API usage helps models understand intent better than prose descriptions. Engineers should avoid MCP servers that fill context windows with garbage documentation.
The model learns from patterns in the codebase:
- Function naming conventions and parameter ordering
- Error handling approaches and validation patterns
- Type definition structures and generic usage
- Test organization and assertion styles
What Models Should You Use for Different Tasks?
Strategic model selection optimizes both cost and quality by matching model capabilities to task complexity. Expensive smart models like Opus or GPT-4 handle planning exclusively, while cheap fast models like Composer or Groq execute implementations. This separation prevents overspending on routine code generation.
Anthropic models and Composer excel at reliable tool calling, making them ideal for tasks requiring verification harness interaction. Claude Opus 4.5 currently serves as the preferred model for most coding tasks. Different models suit different stages: planning versus execution versus review.
Engineers develop intuition for when manual coding beats prompting through experience. AI excels at one-off projects and experiments developers might otherwise skip. Greenfield and small projects work best, though large projects succeed with proper planning and context management.
How Should You Use AI for Code Review?
AI code review tools like Code Rabbit, Griptile, and Graphite should operate on pull requests rather than in the editor. Pull requests group related work and provide one final AI check before merging to production. Reviews catch type safety issues and logic errors humans might miss.
Griptile caught an undefined tool results bug in one project that would have shipped without AI review. AI reviews provide confidence scores and specific line-by-line feedback with explanations. Engineers can commit AI suggestions directly from the review interface, streamlining the fix-and-merge workflow.
The PR-based approach separates the building phase from the reviewing phase. Developers focus on implementation in the editor using Command+E for agent mode and Command+K for inline edits, then rely on AI review tools to catch issues before merge.
What Editor Workflow and Hotkeys Work Best?
Cursor hotkeys enable rapid switching between different interaction modes. Command+E switches to agent mode for planning and execution tasks, while Command+K handles inline edits in editor mode. Engineers should use voice input via Whisper Flow for prompting because speaking provides more contextual detail than typing.
The workflow alternates between editor view for reviewing generated code and agent view for building new features. git add -p enables mini-reviews during commits by showing changes in chunks. Lazy Git (invoked with lg30) accelerates PR creation compared to GitHub CLI.
Voice prompting feels awkward initially but provides richer context. Developers naturally include more background information and constraints when speaking compared to typing terse instructions. The additional context improves model outputs significantly enough to justify the learning curve.
What Prompt Engineering Techniques Actually Work?
Effective prompts balance requirements with verification instructions, accepting that a 50-50 ratio produces better results than pure feature descriptions. Engineers should call out specific mistakes observed in previous attempts to prevent recurrence. Explicitly listing validation commands the model should run improves reliability.
Prompts should include migration guides and documentation links relevant to the task. Specifying exact package versions prevents models from implementing outdated APIs. Writing code showing desired API usage, then asking the model to implement it, communicates intent more clearly than prose descriptions.
Key prompt components include:
- Detailed plan or architecture outline
- Specific validation commands to run
- Examples of desired output format
- Known pitfalls or mistakes to avoid
- Exact dependency versions required
- Links to relevant documentation
When Should You Code Manually Instead of Using AI?
Engineers should never use AI to build things they don't understand. If the agent produces outputs far from the target despite multiple attempts, developers should add more context and verification harnesses or simply code manually. Experience develops gut feel for when manual coding beats prompting.
AI excels at one-off projects and experiments developers might otherwise skip due to time constraints. Ten-minute builds for ideas that previously required 30-60 minutes of focused work become feasible. Greenfield and small projects work best, though large projects succeed with proper planning.
Sometimes pushing through difficulties teaches new prompting skills that apply to future tasks. The learning investment pays dividends across projects. However, developers shouldn't force AI usage when manual coding would clearly be faster—the goal is productivity, not dogmatic tool adoption.
What Broader Benefits Come from AI-Assisted Development?
Getting better at instructing AI improves communication skills with human coworkers. Clear reproduction steps and test harnesses written for AI translate directly to better team communication. Engineers write more tests and example cases than before because AI reduces the friction of test creation.
Formalizing plans more frequently improves architectural thinking. Developers consider edge cases and validation requirements upfront rather than discovering them during implementation. Building experiments and side projects that would have been skipped before becomes feasible.
The workflow changes how engineers think about code quality and maintainability. Tests serve dual purposes as validation harnesses and model training examples. Documentation becomes executable examples rather than stale prose. Architecture decisions get formalized in plans that serve as living documentation.
What the Experts Say
"This is not a Vibe coding tutorial. We're not here to recommend ways to write code without understanding code. If you don't know how to code, go learn how to code."
This quote establishes the fundamental prerequisite for effective AI-assisted development—existing programming expertise remains essential for evaluating outputs and architecting solutions.
"Treat the prompt as the thing that you're maintaining between attempts, not the code."
This insight captures the economic shift in software development where code generation has become cheap enough to treat as disposable, fundamentally changing how developers should approach failed implementations.
Frequently Asked Questions
Q: Can beginners use AI coding tools to learn programming?
No. AI coding assistants require existing programming expertise to evaluate outputs, debug issues, and architect solutions effectively. These tools accelerate work engineers already know how to do rather than teaching fundamentals. Beginners should learn traditional programming first, then adopt AI tools to increase productivity.
Q: How much does effective AI-assisted coding cost per month?
Cursor's $20/month tier provides sufficient capacity for heavy usage when developers use strategic model selection. Expensive smart models like Claude Opus handle planning exclusively while cheap fast models like Composer execute implementations. This approach prevents overage fees while maintaining high output quality across all development tasks.
Q: What's the typical success rate for AI-generated code?
For every successful merge, developers typically produce 4-5 discarded attempts with iterative plan refinements. This disposable approach prevents fixation on flawed implementations and encourages rapid experimentation. Engineers should treat code as cheap enough to regenerate completely rather than fixing problematic outputs incrementally.
Q: How do verification harnesses improve AI model performance?
Verification harnesses provide models with tools to check their own work, improving output quality more than using smarter models. Simple validation commands like bun run tsc for type-checking catch errors before execution. Tightening the feedback loop with dry run modes and explicit validation instructions dramatically increases reliability.
Q: Should AI review code in the editor or in pull requests?
AI code review tools like Code Rabbit, Griptile, and Graphite should operate on pull requests rather than in the editor. Pull requests group related work and provide one final AI check before merging. This separation allows developers to focus on implementation in the editor while relying on AI to catch issues before production.
Q: What types of projects work best with AI coding assistants?
Greenfield and small projects work best, though large projects succeed with proper planning and context management. AI excels at one-off projects and experiments developers might otherwise skip. Ten-minute builds for ideas that previously required 30-60 minutes of focused work become feasible with effective AI assistance.
Q: Why are code examples better than documentation for AI context?
Concrete code examples provide models with actual implementation patterns rather than abstract descriptions. Cloning dependency repositories as subtrees and providing test files gives models better context than traditional documentation. Larger codebases can improve agent performance because more pattern examples are available for reference.
Q: How do git work trees enable parallel AI experimentation?
Git work trees allow multiple branches to exist in separate directories simultaneously, enabling parallel execution of different AI models on identical tasks. Developers can launch Composer, Opus, and Gemini simultaneously on the same problem, then compare results to identify which models excel at specific task types.
The Bottom Line
AI-assisted coding fundamentally transforms software development by treating code as disposable and prompts as maintained artifacts, but success requires existing programming expertise and strategic workflow design. Engineers who implement planning-first development with verification harnesses, parallel experimentation through work trees, and strategic model selection achieve 3-6x productivity improvements while keeping costs at $20/month.
The broader implications extend beyond productivity gains. Formalizing plans for AI consumption improves architectural thinking and team communication. Writing verification harnesses and example code creates better documentation and test coverage. Building experiments that would have been skipped before accelerates learning and innovation.
Start by implementing verification harnesses in your current projects—add type-checking commands, create dry run modes for long-running tests, and write example files showing desired API usage. These improvements benefit both AI-assisted and manual development workflows while building the foundation for effective AI collaboration.
Sources
- How To Code With A.I - Original Creator (YouTube)
- Analysis and summary by Sean Weldon using AI-assisted research tools
About the Author
Sean Weldon is an AI engineer and systems architect specializing in autonomous systems, agentic workflows, and applied machine learning. He builds production AI systems that automate complex business operations.