I’ve consulted several groups helping to optimize their AI agent workflows. This is part of a series on basic agent architecture to help clarify core mental models and avoid costly design mistakes.
With model capabilities going parabolic, attention is turning to the control plane (or “harness” - the orchestration layer between your code and your model) as the next bottleneck. It seems to be a source of low-hanging fruits as well as contention from the model providers who have very good reasons to force you to use theirs.
Many AI users are happy to treat the harness as a solved problem within their IDE of choice, or as a compositional primitive in their orchestration system (“Claude Code instances lashed together”).
However, examining some of the most basic workflows implies a better way forward!
These are simplified illustrations. Production frameworks handle these specific cases, but the pattern applies everywhere. Most projects have similar inefficiencies waiting to be optimized.
Re-Learning The Whole Codebase At Every Step
You task an agent within a workspace. It knows how to orient itself:
- System prompt
- Tasking prompt
- Command-line tool calls:
pwd,cat AGENTS.md, or whatnot.
After ascertaining the structure and identifying the locations of interest, it proceeds. Now during the problem-solving phase, the orientation steps are just noise. Why do we need to infer these command line operations to begin with?
Instead of CLI tools, we could expose a prompt-rewriting wrapper called orient that brings in the directory tree and picks out the potential relevant files to feed forward into the actual task execution stage.
These precious early-stage token savings compound through the rest of the context. The orientation alone can consume 15-20% of your context tokens as it’s dragged through every subsequent reasoning stup.
Paying A Bot To Read Terminal Output
At the end of a task, the agent knows to compile and test. It makes the appropriate CLI call and ingests the whole output.
First, note that this is all happening at the tail of all the task-related context: Unnecessary cost.
Next, note the extra overhead involved in generating the compile command and reading from the entire terminal: Unnecessary cost.
A compile tool should wrap the CLI call, parse and truncate any errors or warnings.
Terminal Management Anti-Pattern
Have you ever seen an agent try to kill a process running in a different terminal, so it can run its own for testing purposes? This is an anti-pattern if I’ve ever seen one.
How about for Nix users, where the agent needs to discover a flake.nix before it knows how to enter the development shell?
A test tool should be overridden to fit the workflow at hand. Maybe it does need to start its own instance. Maybe the reins go to the user who’s active in a different window and gives a validation response.
Summary
Harness development is the next critical step for lowering costs, improving outcomes, and improving security of AI-assisted workflows. You don’t need to build everything yourself, but understanding the harness/model boundary helps you choose better tools and know when to customize.
Building agent workflows? Email me to discuss your use case for harness design and optimization.