Chapter 4: Agent Mode (The Way That Works) cover

Chapter 4: Agent Mode (The Way That Works)

AgentSpek - A Beginner's Companion to the AI Frontier

by Joshua Ayson

I don't think in fragments. I don't think in lines. I think in systems. In architectures. In complete solutions to complete problems. So I stopped fighting autocomplete and found what actually works, agent mode.

Dijkstra said the programmer should let correctness proof and program grow hand in hand. In agent mode, they do. The specification and the implementation emerge together, each informing the other.

I Stopped Fighting

This chapter describes my workflow. Your path will differ. What works for my brain and my projects may not work for yours. Cursor, Windsurf, GitHub Copilot, or dozens of other approaches might serve you better. Those are the names as of late 2025. Half of them will have merged or renamed by the time you read this, which is rather the point. One data point in a fast-moving field.

I tried autocomplete. Copilot, inline suggestions, the whole predictive typing dance. Everyone said it was revolutionary.

It drove me insane.

I do not think in fragments. I do not think in lines. I think in systems. In architectures. In complete solutions to complete problems. The constant interruption of suggestions mid-thought felt like someone whispering answers during an exam. Helpful in theory and distracting in practice.

So I stopped fighting and found what works for me. Agent mode. Full delegation to Sonnet, with the freedom to explore and to solve the problem end-to-end.

The Agent Mode Mindset

Instead of “complete this line,” you say “solve this problem.” You specify the outcome and let the intelligence make it, and what you are delegating is architecture.

When I need to build a data pipeline for my blog, I do not start typing def transform and wait for Copilot to finish my thought. I open Claude Code and describe the system I want to exist.

“Build a Python content processing pipeline that reads markdown from editing/revisions/, extracts metadata, processes images for responsive sizes, and populates Neo4j with content relationships. Handle errors gracefully. Make it fast.”

And Sonnet builds it.

End to end, architecture and implementation and error handling, the works.

It frees me to think at the architecture level while the implementation happens in parallel.

The Tools

My workflow has two tools. VS Code for reading and refining. Claude Code from the command line for building. Others do the same with Cursor’s agent mode or Windsurf. Keeping review and generation apart matters more than which tools.

VS Code is where I read code and understand the system, and where I refine it, not where I write it. I open a Python script the agent generated and read through the logic. Spot the edge cases that need handling. Then I describe what needs to change, and the agent makes it happen. VS Code is my lens into the codebase, my thinking space.

The command line is where the work happens. I describe what I want and the AI builds it. I review in VS Code, refine the specification, the agent updates it. The CLI keeps me on outcomes instead of keystrokes.

# Typical workflow example (Claude Code, late-2025 syntax; the binary is `claude`)
claude "optimize the image processing pipeline to handle WebP conversion in parallel"

# Review in VS Code
# Refine

claude "add caching so unchanged images skip processing entirely"

# Iterate until it's right

(Commands as of late 2025. The flags and even the tool names will have drifted by the time you read this. Check the current docs; the workflow is what matters.)

This separation matches how my brain works. I do not want to write code, I want to architect systems, and the tools should match the thinking. Find the combination that matches yours.

Unattended Mode

The most powerful discovery was running AI agents unattended inside containers.

When I have a well-defined problem but want to explore multiple solutions, I spin up a container and let the AI experiment overnight. “Here is the content processing pipeline. Find the bottlenecks. Try three different optimization approaches. Document the results.”

I wake up to a report comparing sequential vs. parallel processing vs. incremental updates, complete with benchmarks, trade-off analysis, and working implementations of each.

This is different work. I am specifying experiments and reviewing results. The container keeps the experiments isolated, and unattended means I am not waiting. The agent thinks its way through the options instead of brute-forcing them.

This workflow will not appeal to everyone. Some developers prefer tighter loops and more direct control. Know yourself.

Architecture-First

Some developers think in lines of code. They see the solution as they type it, and autocomplete makes sense for them.

I think in systems. In data flows. In architectures. By the time I am ready to implement, I already know what needs to exist. The typing is just transcription, and transcription is what AI should handle.

“Build AWS CDK infrastructure for static site hosting with CloudFront distribution, S3 origin, and automated deployment from GitHub actions.”

If that sentence is a wall of Amazon product names to you: CDK is the Cloud Development Kit, a way to write your cloud setup as code instead of clicking through web consoles. S3 is Amazon’s file storage. CloudFront is a CDN, a content delivery network, a ring of servers around the world holding copies of your site close to whoever asks for it.

Sonnet understands this because the instruction is complete. It has the architectural intent. The implementation that comes back handles details I would have gotten wrong or forgotten, CloudFront cache invalidation, S3 versioning for rollback, the IAM policies, error handling in the deployment scripts, and I did not prompt for any of them. Agent mode thinks in complete solutions.

Model Choice for My Use Case

I’ve tried different models in agent mode. GPT variants, Claude models, others as they emerge.

For my workflow, systems architecture and end-to-end implementations, Claude Sonnet consistently gives me the most coherent systems. Not always the cleverest code. The most thought-through architecture for what I build.

When building a content processing pipeline, Sonnet does not stop at transforming markdown to HTML. It considers what happens when a file is malformed. How to handle images that do not exist. What if two posts reference each other cyclically. How to make this fast without making it fragile.

That systems thinking is why I stick with Sonnet for agent mode. It builds like an architect.

Your mileage may vary. GPT-4 excelled at different tasks in its day, and newer models keep redrawing the map. Find the model that thinks the way you think.

Sonnet 4.5, My Current Default

At the time of this writing, Sonnet 4.5 is the model I use for almost everything in agent mode.

It handles the big architectural decisions, keeps its context across a long build, and asks when my specification is ambiguous.

Whether it is “the best” on some benchmark is a different question. It thinks the way I think, in systems, in implications, in trade-offs.

When I specify Neo4j integration for content relationships, it goes past writing Cypher queries. It designs a schema that makes sense, handles relationship updates without breaking things, and puts in transaction boundaries so the data stays consistent.

This is architecture.

(By the time you read this, newer models will exist. The principles matter more than the specific version numbers.)

The Review Cycle

A place to review and a tool that builds, together, make a workflow that matches how I actually think. Specify what needs to exist. Let AI build the complete implementation. Review in your IDE with full context. Refine the specification based on what you see. Iterate until it is right.

This cycle respects how understanding actually develops. You cannot fully specify a solution before you see it, so you iterate, at the architecture level rather than the line.

The IDE gives you the whole codebase, many files open, and how the pieces fit together. The agent does the building. Together, they let you work at the level of “what should exist” instead of “how to type it.”

Different Models for Different Thinking

Sonnet handles implementation in agent mode. But for research and conceptual exploration, I sometimes use GPT or other models.

When I am trying to understand graph database modeling approaches, I do not jump to implementation. I explore the conceptual space first. “Compare event sourcing vs. snapshot models for content versioning in Neo4j. What are the trade-offs?” Some models are good at the broad view, seeing patterns across domains, helping you think through approaches before committing. Then I take what I learned back to the agent that builds.

Different models for different kinds of thinking, one for the divergent part and another for the convergent building. Your combination will be different from mine.

The Container Experiment Pattern

Running an agent unattended inside a container has become one of my favorite ways to attack an ambiguous problem.

The Setup (Example with Claude Code)

# Spin up your own dev container. There is no official Claude Code image;
# you build one with your language toolchain plus the agent CLI installed.
docker run -it --rm -v $(pwd):/workspace my-agent-sandbox

# Inside the container, run Claude Code headless against the task file
claude -p "Work through the experiment described in optimize-content-pipeline.md"

(Syntax as of late 2025: the binary is claude, and -p runs it non-interactively. Other agent tools have similar capabilities, and every flag here will eventually drift. The pattern matters more than the specific implementation; check the current docs.)

The Experiment Task File

# Task: Content Pipeline Optimization

## Context
Current pipeline processes all markdown files sequentially.
Build times have grown from 2 minutes to 15 minutes.
Processing includes: markdown parsing, image optimization, Neo4j updates.

## Experiment Goals
1. Identify actual bottlenecks (don't assume)
2. Implement 3 different optimization approaches
3. Benchmark each with real content
4. Document trade-offs

## Success Criteria
- Build time under 5 minutes for full rebuilds
- Incremental builds under 30 seconds
- No regression in output quality
- Maintainable code (we'll be living with this)

## Constraints
- Must work with existing AWS CDK infrastructure
- Can't break Neo4j relationship integrity
- Need to handle both full and incremental builds

What I Wake Up To

A complete report. The bottleneck was image processing, not Neo4j. Three working implementations, parallel processing, caching, and a hybrid of the two. Benchmarks with actual numbers, the trade-offs of each, a recommendation with its reasoning.

Actual exploration happening while I sleep. Your results may vary. This takes trust in your agent and a clear specification, and a container you have set up well.

Why This Works (For Me)

Autocomplete optimizes for the line. Agent mode optimizes for the system.

I do not care about typing speed. I care about architectural clarity, about systems that work, about solving the whole problem instead of the next piece of it.

When an AI agent builds a complete AWS CDK stack, it is faster because it considers the entire system at once. CloudFront configuration that matches the S3 bucket settings. IAM policies that grant exactly the right permissions. Deployment scripts that handle failure, error handling that cascades properly. These come from specifying the complete outcome.

If you prefer the tighter feedback loop of autocomplete, that is just as valid.

The Learning Curve

Agent mode has a different learning curve than autocomplete. With autocomplete you learn to accept and reject suggestions quickly, and it builds on the typing you already do. With agent mode you learn to specify outcomes clearly, which takes architectural thinking.

If you think in systems, agent mode feels right away like the tool finally matches the thinking. If you think in lines, autocomplete makes more sense. Neither is better.

I tried autocomplete for months and it never felt natural. Agent mode felt right immediately, because it matched how I already think about problems.

Building Trust

Agent mode requires trust in ways autocomplete does not. With autocomplete, you see every suggestion. You are always in control. With agent mode, you are delegating complete implementations.

Start with small, well-defined tasks. “Add error handling to this function.” “Optimize this database query.” “Generate test cases for this module.” Review the output carefully. Understand how Sonnet thinks. Gradually increase delegation. “Refactor this module for better performance.” “Build a caching layer for this API.” “Create AWS CDK infrastructure for static hosting.” Eventually you are delegating entire systems. Content processing pipelines. Graph database schemas. End-to-end deployment automation.

Trust comes from experience you have checked.

Practical Patterns

The Specification File

Create a markdown file describing what should exist:

# Content Processing Pipeline

## Purpose
Transform blog posts from markdown to deployed static site with graph database integration.

## Components
1. Markdown processor: Parse frontmatter, extract metadata, render HTML
2. Image optimizer: Convert to WebP, generate responsive sizes, update references
3. Graph builder: Map content relationships in Neo4j
4. Deployment orchestrator: Coordinate AWS CDK deployment

## Quality Gates
- All images under 200KB
- Build time under 5 minutes
- No broken internal links
- Neo4j relationships match content reality

Feed this to Claude Code in agent mode. Let Sonnet build it.

The Refinement Loop

Specify the initial system. Review the implementation. Identify gaps or improvements. Refine the specification. Iterate until satisfied. This is iterative architecture, and the iteration happens at the system level rather than the line.

The Unattended Experiment

When you have time but not clarity, write the experiment specification, launch it in a container unattended, do other work or sleep, then review the results and choose a direction from the evidence. Sonnet explores the solution space while you explore the problem space.

What I Have Built This Way

In the months since I moved beyond prompting and into agent mode with Sonnet, I have built a complete Astro blog content management system with markdown processing, Neo4j integration for content relationships, automated image optimization, and AWS CDK infrastructure. Build time, three minutes for 200+ posts. A data processing pipeline with ETL from multiple APIs to graph database, error handling with retry logic, performance optimizations, and monitoring. Deployment automation with GitHub Actions, infrastructure as code, rollback capabilities, and health checks.

None of it was typed line by line. All of it was specified, and Sonnet built it in agent mode.

The Mental Shift

The hardest part of agent mode is the mental model. You stop thinking like an implementer and start thinking like an architect. The questions change. “What system should exist” in place of “how do I write this code.” “What are the constraints and requirements” in place of “what is the syntax.” “Let me specify this outcome” in place of “let me type this.”

This feels unnatural at first. We are trained to equate programming with typing. Agent mode asks you to let go of the typing and focus on the thinking.

For some developers, this feels like loss of control. For others, it feels like finally working at the right level of abstraction.

Why Not Both

People ask why I do not use both. Autocomplete for some tasks, agent mode for others.

Because the mental models conflict. Autocomplete keeps you in line-by-line thinking. You are always half-waiting for the next suggestion, half-evaluating whether to accept or reject. Agent mode requires complete architectural thinking. You cannot specify a system while thinking in lines. Switching between them creates cognitive whiplash.

I chose agent mode because my brain works in systems. Your choice might be different. But trying to use both simultaneously fragments your thinking.

Already Here

Agent mode is here now. Several tools can build complete systems from an architectural specification today. Claude Code, Cursor, aider, Windsurf, to name the late-2025 cast.

The limit is whether this style of work matches how you think. Can you specify what should exist without specifying how to build it? Can you review a complete implementation and identify what needs refinement? Can you trust delegation enough to let AI work while you think?

If yes, agent mode might transform how you work. If no, autocomplete might serve you better.

Beyond Development

What started as a development workflow evolved into something deeper. Agent mode began as how I build software. It has become how I think and how I reflect.

I converted my personal journal into a VS Code repository integrated with agent mode. Every thought, every reflection, every insight captured in markdown with agent collaboration available. It does not write for me. It helps me think more clearly and see what I missed. Then came work. I migrated from OneNote to VS Code repos. Meeting notes, project documentation, planning, all of it living where I can invoke agent mode to find the patterns and the gaps.

Much of my reflection now happens there. Every morning intention. Every evening review. The agent helps me see patterns I would miss and questions I should be asking but was not.

This only works because it is balanced.

Exercise keeps me in the body. Meditation keeps me present. Family reminds me what matters beyond systems and optimization, and animals teach a connection that has no language in it. Real-world experience keeps a toe on this planet, showing me what is still true outside the digital.

You temper metal on a hot iron. The heat transforms the material, but you need the anvil too. The resistance. The real world pushing back against the malleable digital.

Agent mode amplifies my thinking and does not replace my living. The danger is letting these tools become the only place you live, the only way you think, the only mirror you see yourself in.

I live in agent mode for work and reflection. I live in life for everything that makes work and reflection worth doing. We are on a rock hurtling through space, and the agent does not think for me. It thinks with me.

Sources and Further Reading

This chapter builds on Edsger W. Dijkstra’s “The Humble Programmer” (ACM Turing Award Lecture, 1972), particularly his insight that “the programmer should let correctness proof and program grow hand in hand.” In agent mode, the correctness proof and implementation can grow together through specification-driven development.

The discussion of different cognitive styles in programming draws from research in cognitive psychology, particularly work on systematic versus intuitive thinking, though applied here to the choice between autocomplete and agent-based development.

For those interested in architectural thinking, Christopher Alexander’s “Notes on the Synthesis of Form” (1964) provides foundational concepts about separating design intent from implementation details.

Douglas Engelbart’s “Augmenting Human Intellect” (1962) envisioned computers amplifying human thinking. Agent mode realizes this vision by handling implementation while humans focus on architectural thinking.

For practical implementation, current documentation for Claude Code and Anthropic’s agent capabilities provides technical details, though the field evolves rapidly as agent capabilities improve.


Next: Chapter 5: The Socratic Partner (Conversational Mode)

← Back to AgentSpek


© 2025 Joshua Ayson. All rights reserved. Published by Organic Arts LLC.

This chapter is part of AgentSpek: A Beginner’s Companion to the AI Frontier. All content is protected by copyright. Unauthorized reproduction or distribution is prohibited.