Agentic Development Patterns — Building Software with AI Agents
Practical patterns and workflows for agentic software development using Claude Code, Cursor, and local LLMs — from parallel workstreams to overnight agent factories.
Agentic Development Patterns
The way I build software has fundamentally changed. Instead of writing every line myself, I now orchestrate AI agents that handle implementation while I focus on architecture, requirements, and quality. This isn’t about replacing developers — it’s about amplifying what a single developer (or small team) can achieve.
After 25+ years of writing code, I can confidently say this is the biggest productivity shift I’ve experienced — bigger than the move to agile, bigger than cloud, bigger than CI/CD. Here are the patterns that work.
My Development Stack
Primary: Claude Code (Max Subscription)
Claude Code is a CLI tool that operates as an autonomous coding agent. It reads your project files, understands context from CLAUDE.md specifications, and executes multi-step implementation tasks: creating files, editing code, running tests, fixing errors, committing to git.
Why it’s my primary tool:
- Deep codebase understanding: It reads and indexes your entire project, not just the current file
- Autonomous execution: Give it a task, walk away, come back to a working implementation
- CLAUDE.md integration: Project-level specifications guide every interaction without repetition
- Tool use: It runs shell commands, reads files, searches code — the full development cycle
- Git awareness: It creates commits, understands branches, respects your workflow
I run Claude Code sessions in tmux so they persist across terminal closures. Multiple sessions in different panes, each working on a different worktree.
Secondary: Cursor Pro (Agent Mode)
Cursor complements Claude Code for tasks where visual context matters:
- Code review: Seeing diffs inline with syntax highlighting is faster than reviewing in terminal
- UI work: When building frontend components, seeing the code and the result side by side
- Refactoring exploration: Agent mode for “try this three different ways and let me compare”
- Quick edits: For small, focused changes where spinning up a Claude Code session is overkill
Tertiary: Local LLMs (Qwen3-Coder via MLX/Ollama)
For quick queries, offline work, and sensitive code that shouldn’t leave my machine:
- Code explanations and documentation lookups
- Simple refactoring suggestions
- Brainstorming and rubber-ducking
- Processing proprietary code or data I don’t want to send to cloud APIs
Core Patterns
Pattern 1: Specification-Driven Development
The most important pattern. Instead of writing code, write detailed specifications and let agents implement against them.
# CLAUDE.md (or task specification)
## Feature: Support Ticket Dashboard
### Requirements
- Table view with sortable columns: Ticket Type, Customer, Priority, Age, Status
- Filter bar with multi-select dropdowns for each column
- Click row to open detail panel (slide-out right)
- Detail panel shows: ticket details, audit trail, action buttons
- Actions: Approve, Reject, Escalate, Reassign
### Technical Constraints
- Use existing DataTable component from src/components/ui/
- State management via Zustand store (pattern in src/stores/)
- API calls via React Query (pattern in src/hooks/)
- Follow existing Tailwind design tokens
### Acceptance Criteria
- All columns sortable ascending/descending
- Filters persist across page navigation
- Detail panel animates in from right (300ms ease-out)
- Loading and error states handled
- Unit tests for the Zustand store
The spec becomes the contract between human intent and machine execution. I’ve found that 30 minutes spent writing a clear spec saves 3+ hours of back-and-forth with agents. The spec forces me to think clearly before implementation begins — a discipline that improves outcomes regardless of whether humans or agents write the code.
Pattern 2: Parallel Agent Workstreams
Using git worktrees, I run multiple agents simultaneously on independent features. Each agent gets its own isolated environment — its own branch, its own working directory, zero interference with others.
# Set up parallel workstreams
git worktree add ../project-feature-a feature/dashboard-redesign
git worktree add ../project-feature-b feature/api-v2-migration
git worktree add ../project-feature-c feature/test-coverage
# Terminal 1: Claude Code on feature A
cd ../project-feature-a && claude
# Terminal 2: Claude Code on feature B
cd ../project-feature-b && claude
# Terminal 3: Cursor agent mode on feature C
# Open ../project-feature-c in Cursor
I typically run 2-3 parallel workstreams during focused work sessions. Each agent is working on an independent feature with no shared state. I context-switch between panes to check progress, provide guidance when agents get stuck, and review completed work.
Key discipline: Features must be truly independent. If two agents need to modify the same files, they’ll create merge conflicts that negate the productivity gains. Plan your work decomposition accordingly.
Pattern 3: The Overnight Agent Factory
My highest-leverage pattern. Before ending the day:
- Write specs for 2-3 features or tasks
- Create worktrees and branches for each
- Kick off Claude Code sessions in tmux panes with clear instructions
- Sleep
- Morning review: Assess results, fix issues, merge what’s good
What I’ve learned about making this work:
- Comprehensive specs are non-negotiable. Vague instructions produce vague results overnight with no chance for clarification.
- Test suites are essential. Agents need automated validation to self-correct. If your project has good tests, agents can iterate to green. If it doesn’t, you get untested code.
- Scoped tasks work best. “Implement this API endpoint with these 5 tests” succeeds overnight. “Redesign the architecture” does not.
- Expect 70-80% hit rate. Maybe 2 out of 3 overnight tasks produce shippable code. The third needs refinement. That’s still enormous leverage.
Pattern 4: Agent-Assisted Code Review
Use one agent to implement and another to review:
- Feature agent implements a change
- Review agent reads the diff and the specification
- Review agent identifies issues: missing edge cases, inconsistencies with codebase patterns, potential bugs
- Feature agent addresses feedback
This creates a form of AI pair programming where disagreements between agents often surface genuine design issues. It’s not perfect — both agents can share the same blind spots — but it catches a surprising amount of real problems.
Pattern 5: Progressive Delegation
Not everything should be agent-driven. My hierarchy:
| Task Type | Approach | Tool |
|---|---|---|
| Architecture decisions | Human-driven, AI-advised | Whiteboard + Claude chat |
| Complex business logic | Human-driven, agent-implemented | Claude Code with detailed spec |
| Standard features | Agent-driven, human-reviewed | Claude Code autonomous |
| Boilerplate / CRUD | Agent-driven, light review | Claude Code or Cursor agent |
| Tests from existing code | Agent-driven, verify passes | Claude Code |
| Documentation | Agent-driven, minimal review | Claude Code |
| Refactoring | Agent-driven, diff review | Cursor agent mode |
The key insight: match the level of human involvement to the level of judgment required. Don’t waste your time hand-writing CRUD endpoints. Don’t delegate security architecture to an agent.
Pattern 6: CLAUDE.md as Living Documentation
Your CLAUDE.md file isn’t a one-time artifact — it evolves with the project:
- Day 1: Basic project overview, tech stack, file structure
- Week 1: Add coding conventions learned from early agent output (“Don’t use default exports”, “Always use named functions”)
- Month 1: Include common patterns, architectural decisions, and anti-patterns to avoid
- Ongoing: Update when adding new libraries, changing patterns, or learning from agent mistakes
Every correction you make to agent output should flow back into the CLAUDE.md as a rule. Over time, agents make fewer mistakes because the spec gets better. It’s a flywheel.
What Works and What Doesn’t
Agents Excel At
- Boilerplate and CRUD: Generating standard patterns, API endpoints, database schemas, form components
- Test generation: Writing unit and integration tests from existing code
- Refactoring: Renaming, restructuring, applying consistent patterns across a codebase
- Format conversion: Migrating between frameworks, updating API versions, converting between languages
- Documentation: Generating docs from code, README files, API documentation
- Implementing well-specified features: When the spec is clear, agents deliver reliably
- Learning new frameworks: Agent + docs = faster ramp-up than reading docs yourself
Agents Struggle With
- Novel architecture decisions: They can implement patterns but shouldn’t choose them
- Ambiguous requirements: Garbage in, garbage out — vague specs produce vague implementations
- Deep domain logic: Business rules that require organizational context and stakeholder empathy
- Performance optimization: They optimize for correctness, not always for efficiency
- Security: Never trust agent-generated code for security-critical paths without thorough review
- Large-scale coordination: Multi-service changes with complex dependencies still need human orchestration
The Productivity Reality
For an experienced developer who invests in learning these patterns, the multiplier is real:
- Implementation speed: 5-10x for well-specified features
- Test coverage: 3-5x more tests written because the marginal cost approaches zero
- Code consistency: Higher, because agents follow CLAUDE.md conventions more reliably than humans follow style guides
- Total throughput: A single developer with agentic tooling matches the output of a 3-4 person team for many workloads
But the multiplier depends entirely on specification quality and project infrastructure (tests, CI, clear architecture). An agent operating in a well-structured codebase with good specs and tests is 10x. An agent in a messy codebase with no specs and no tests is 1x — or worse, because you’re debugging agent-generated spaghetti.
The Developer’s Evolving Role
The skill ceiling has risen, not fallen. You need to be a better engineer to effectively direct AI agents than to write code manually:
- Better at specification: Clear specs produce clear code
- Better at architecture: Agents implement your design; the design still needs to be good
- Better at code review: You’re reviewing more code, faster, with higher stakes
- Better at decomposition: Breaking work into agent-sized, independent chunks is a skill
- Better at quality judgment: Knowing “good enough” from “needs more work” when reviewing agent output
The developers struggling with agentic tools are often the ones who skip the specification step, don’t review agent output carefully, or try to use agents for tasks requiring deep judgment. The ones thriving treat agents as extremely capable junior developers who need clear direction and thorough code review.