The modern developer's workflow has shifted from writing code with an AI assistant to orchestrating a fleet of them. In the current era of agentic IDEs and autonomous coding frameworks, the temptation to delegate is omnipresent. A developer encounters a tedious refactoring task or a sprawling set of bug fixes and, with a single command, spawns a sub-agent to handle the grunt work. The promise is a seamless handoff where the main AI manages the architecture while the sub-agent executes the details. However, as these workflows scale, many teams are noticing a paradoxical spike in token consumption and latency that defies the logic of using smaller, cheaper models for delegated tasks.

The Mechanics of Delegation Costs

When a main AI agent delegates a task to a sub-agent, the process is not a zero-cost handoff. There are two primary fixed costs that trigger the moment a sub-agent is initialized. The first and most impactful is the loss of prompt caching. In a primary conversation, the LLM utilizes a cache to store the state of the project files and previous dialogue, allowing it to reference the codebase without re-processing every line of code in every turn. A sub-agent, however, typically starts as a fresh session. It cannot inherently share the active cache of the parent agent. Consequently, the sub-agent must re-read the relevant project files from the beginning to establish the necessary context. If a project consists of several large modules, the sub-agent consumes a massive block of input tokens just to reach the same baseline of understanding that the main agent already possessed.

The second fixed cost resides in the instruction overhead. For a sub-agent to be effective, the main agent must generate a precise, comprehensive set of instructions. This is not a simple one-sentence command but a detailed specification that includes the goal, the constraints, the files to modify, and the expected output format. The tokens used to generate these instructions, and the tokens used by the sub-agent to ingest them, represent a non-trivial overhead. When these two factors combine, the cost of simply starting a sub-agent can often exceed the cost of the actual code generation itself.

The Efficiency Paradox of Sub-agents

This cost structure creates a sharp divide between tasks that should be handled directly and those that warrant delegation. For small-scale operations, such as fixing a known bug in a single file or updating a few variable names, the overhead of delegation is mathematically irrational. In these scenarios, the main agent can apply the fix using its existing cache in a fraction of the time and cost. The act of spawning a sub-agent for a five-line change is akin to hiring a new contractor to change a single lightbulb; the administrative cost of onboarding outweighs the labor itself.

Delegation becomes a strategic advantage only when the volume of work reaches a critical mass. When a task requires simultaneous changes across dozens of files or involves repetitive transformations—such as converting a large library from JavaScript to TypeScript—the fixed cost of the initial setup is amortized across a vast amount of output. In these cases, the primary value of the sub-agent is not necessarily cost reduction, especially if the sub-model's price point is similar to the main model. Instead, the value lies in parallel processing and the preservation of the main conversation's context. By offloading the noise of repetitive edits to a sub-agent, the developer keeps the main chat window clean and focused on high-level architectural decisions, preventing the primary context window from becoming cluttered with trivial diffs.

However, a dangerous trap emerges when developers delegate tasks with ambiguous specifications. If the goal is not fully crystallized, the sub-agent will likely produce a result that requires correction. This triggers a round-trip cost: the sub-agent's output is sent back to the main agent, the main agent analyzes the failure, generates new instructions, and the sub-agent may need to re-process the context again. This cycle of iteration can lead to an exponential increase in token spend, turning a supposedly efficient delegation into a financial drain.

To navigate this, a strict decision matrix is required. The first filter must be specification clarity; if the goal is vague, delegation is a liability. The second filter is volume; if the task affects only a handful of files, direct execution is superior. The final filter is parallelism; if the task can be split into independent chunks that do not require constant synchronization, the sub-agent becomes the optimal tool.

Ultimately, the effectiveness of an agentic workflow is measured by the ratio of productive output to the overhead of orchestration. As LLM providers improve cross-session caching and state sharing, these fixed costs may diminish, but for now, the most efficient developers are those who treat sub-agents as heavy machinery—powerful for large-scale demolition and construction, but far too expensive for a simple repair.