Skip to content
BENIBIX Learn

delegate_task vs execute_code

People think delegate_task and execute_code both just run work side by side. In fact, they solve two quite different problems. delegate_task starts new agents that think for themselves and send back a summary. execute_code runs one Python script that calls tools in a set order and prints a result. Hand off work when each part needs thought. Use a script when you know the steps.

AI🪽 Hermes Agent

delegate_task Tool

The Hermes tool that gives work to helper agents and gets back short notes.

delegate_task is the Hermes Agent tool that starts child agents to do work on their own. Each child gets a fresh context, its own terminal and the parent's tools. Only its final summary comes back into the parent's chat. Up to 10 children can run at once by default. The parent can keep talking while they work, and gets their results as a new message.

Example
Mia asks Hermes to compare five libraries. It starts five children, one per library, and reads back five short reports.
Why it matters
Each child's searching and reading stays out of the main chat, so the main context stays small.
Full entry
AI🪽 Hermes Agent

execute_code Tool

The Hermes tool that runs one script to call many tools at once.

execute_code is the Hermes Agent tool that lets the agent write a Python script that calls its other tools. The script gets them from a hermes_tools module. It runs on the agent's own machine, in a process of its own. Many tool calls happen inside one turn. Only what the script prints comes back to the model, so the steps in between never fill the context.

Example
Leo needs prices from 30 pages. Hermes writes one script that fetches all 30 and prints a small table.
Why it matters
Thirty tool calls one by one cost thirty turns and fill the context. One script costs one.
Full entry

In one line

delegate_task Tool
The Hermes tool that gives work to helper agents and gets back short notes.
execute_code Tool
The Hermes tool that runs one script to call many tools at once.