Skip to content

Working with AI tools

This chapter connects directly to the automation philosophy we discussed earlier. Just as we automate repetitive tasks to free mental energy for harder problems, AI tools automate the mechanical aspects of coding to let you work at the speed of thought. The key is using them as amplifiers of your capabilities, not replacements for your judgment.

The speed of thought

The primary win that you get with generative AI tools is the ability to code at the speed of thought. This is transformative for productivity.

There's a fascinating paper that illustrates why this is so powerful: humans have approximately \(10^9\) bits/second capacity for information ingestion, but our brain's cognitive processing runs at about 10 bits/second, a \(10^8\) difference in capacity (source). Similarly, there's a significant gap between how fast we can think and how fast we can type.

This is where generative AI comes in. It helps bridge that gap. It's a much faster way to get a polished first draft of code, documentation, and other written work.

The right kind of lazy

Before AI-assisted coding, my productivity bottleneck was, for the most part, my typing speed. Now that we're in a world of GenAI, it's shifted to how quickly I can generate ideas and review written work. The last part is the most important, and is now the new bottleneck. But it's not a bad situation to be in, compared to the old alternative of being bottlenecked by my typing speed.

However, here's the crucial part: while you can and should use AI to accelerate your work, you can't relinquish your intellectual responsibility. There's a difference between being "Bill Gates lazy" and being intellectually lazy. The first means finding the most efficient way to accomplish work. The second means blindly trusting machine outputs without review.

You, the human, must remain responsible for the final output. AI is a powerful tool for augmenting your capabilities, not replacing your judgment.

Effective patterns for AI interaction

The key to working effectively with AI tools is understanding how to structure your interactions. Here's what I've found works best.

Before diving into code generation, spend time articulating what you're trying to accomplish. AI tools work best when you give them context about the problem you're solving, any constraints you're working within, and the style and approach you prefer.

In the old days, you may have had the habit of starting with a fat finger sketch of what needs to be built. Don't skip this. It'll help you gain clarity over what you're trying to accomplish. A vague prompt is no help here, so use whatever tools you need to gain a clear understanding of what you're trying to accomplish. For me, my "fat finger sketch" manifests itself as the code I wish to see myself writing and maintaining, which leaves room for the AI to fill in the details.

One of the biggest mistakes I see is treating AI outputs as final products. Instead, think of them as collaborative drafts. When I work with AI, I start with a rough request, review the output critically, refine my prompt based on what's missing, and repeat until the output satisfies what is in my head. It's perfectly natural for what you're thinking to evolve as you see the output. I would strongly suggest that you embrace this fact, rather than fight it.

Just as you wouldn't trust untested code from a human colleague, don't blindly trust AI-generated code. Develop a habit of reading through generated code line by line, testing edge cases explicitly, verifying that the solution actually solves your problem, and checking for potential security or performance issues.

Beyond code generation

While code generation gets most of the attention, I've found AI tools particularly valuable in three areas that often get overlooked.

Documentation is often the hardest part of a project to get started. I use AI to generate initial function and class docstrings, draft high-level architectural descriptions, and create example usage scenarios. These aren't final products; they're starting points that I enhance with specific knowledge and insights.

AI tools also serve as a preliminary code reviewer. They can identify potential bugs or edge cases, suggest performance optimizations, flag deviations from best practices, and propose clearer variable names. I don't treat their suggestions as gospel, but they catch things I might miss on a first pass.

My favorite use, though, is accelerating the learning process. When exploring new libraries or techniques, I ask for minimal working examples, request explanations of complex code sections, and generate practice exercises with solutions. This has dramatically reduced the time it takes me to get productive with unfamiliar tools.

See this in action

The AI tools we discuss in this section connect to several core philosophies and practices throughout the book.

Automation philosophy

The Automation philosophy emphasizes eliminating drudgery through automation. AI tools are a form of automation that eliminates the mechanical aspects of coding, letting you focus on the harder problems that require human insight. The chapters that follow show how to automate agent training and behavior, creating compound interest dividends in productivity.

Single source of truth

The Standardizing agent behavior chapter demonstrates how to establish a single source of truth for agent behavior. Just as we consolidate configuration in pyproject.toml or data access in catalog functions, AGENTS.md becomes the authoritative source for how your coding agent should behave in your project.

Just-in-time adoption

These practices follow the same just-in-time adoption principle we've emphasized throughout the book. Start with basic AI assistance, then add standardization, safe automation, and advanced workflows as you need them. Don't overthink the setup; begin with simple interactions and evolve your workflow as you discover what works.

Moving forward

The landscape of AI tools is evolving rapidly. The key is developing a mindset that embraces these tools while maintaining intellectual rigor. Don't be afraid of AI tools. Harness them to your advantage. They are tools, part of your toolkit. Sharpen your ability to use them effectively.

Remember: the goal isn't to replace your thinking, but to amplify your capabilities. Use AI to handle the mechanical aspects of coding, freeing your mind to focus on the harder problems that truly require human insight and creativity.