Skip to content

Ch 8: Local vs Worktree vs Cloud-Like Runs

You have unlocked secret 0 of 20 about AI Agents
0%
The Three Workshops

You are building a house. Some jobs you do at your desk — sketching a quick fix on a napkin, checking a measurement. Other jobs need a separate workbench — sawing lumber, test-fitting cabinets — where sawdust will not ruin your blueprints. And some jobs need an entire factory: pouring concrete, stress-testing beams under load. You would not rent a factory to sharpen a pencil. You would not sharpen a pencil on a concrete pour line.

An AI helper faces the same choice every time it picks up a task. The desk is instant, zero overhead, but anything you spill lands on the real project. The workbench takes a few seconds to set up, but your main project stays clean while you saw and hammer. The factory takes minutes to prepare, but it gives you the strongest containment this chapter models.

Each workshop trades speed for isolation. The art is choosing the cheapest one that gives you enough safety for the job at hand.

Why One Execution Mode Is Not Enough

In the last chapter, you gave every task its own separate workspace. That is like renting the workbench for every job — even sharpening a pencil. Fixing a small mistake does not need a separate area, a safety check, and a careful handoff. You are paying setup time for zero benefit.

On the other end, running someone else's untrusted work directly on your desk is like pouring concrete in your living room. If it goes wrong, your entire project is at risk.

Smart helpers do not pick one workshop for everything. They evaluate each task and route it to the right place:

  • Quick check? Run it at the desk. It reads things but changes nothing.
  • Multi-part edit? Use the workbench. Your real project stays safe while the helper works.
  • Untrusted work? Spin up the factory-style lane. In this course, it represents the strongest limits we model, not a true security boundary.
Narrator

You are the workshop manager. Three tasks just arrived. For each one, you need to decide: desk, workbench, or factory?

Order from fastest to most isolated

Drag to reorder, or use Tab + Enter + Arrow keys.

  1. Local: instant, no isolation
  2. Workbench: seconds, repository-working-directory isolation
  3. Factory: minutes, strongest limits in this chapter

Key Insight

The three-workshops approach comes down to one rule: choose the cheapest workshop that gives enough safety for the task.

Running everything in the factory is safe but slow and expensive. Running everything at the desk is fast but dangerous. The sweet spot is dynamic selection — the helper evaluates each task's risk level and picks the right workshop.

A read-only check gets the desk. A multi-part edit gets the workbench. Untrusted work gets the factory-style lane. When in doubt, move one workshop up — the cost of a few extra seconds is always less than the cost of a damaged project.

This is the same principle behind real AI tools: they mix fast paths, review gates, and stronger isolation mechanisms instead of using one mode for everything. They pick the right level of safety for the job.

What's Next

You have completed Part II of OpenAgention. Your agent now has a full execution infrastructure: safe file editing with patches (Chapter 5), policy-based approval gates (Chapter 6), git worktree isolation (Chapter 7), and dynamic execution lane selection (Chapter 8).

Together, these four chapters transform the raw agent loop from Part I into a system that can safely execute complex coding tasks. The agent chooses how to run each task, isolates its work, applies changes surgically, and asks for permission before doing anything dangerous.

In Part III, you will scale this to multiple agents working together: delegation, coordination, and the orchestration patterns that make systems like Codex work at scale.