How-To Series · Episode 45 / 59 · Module 7: Power Tools

Hermes · Code Execution

Skip ten tool calls. One Python block does it all.

After this videoYou can now use Python as Hermes' scripting language for multi-step jobs.

The execute_code tool lets Hermes write a Python script that calls its own tools, with from hermes_tools import ..., collapsing many tool calls into one turn. The win: only the script's print() output returns to the model, intermediate tool results never enter the context window, a huge token saving on bulk work. The classic pipeline is search → extract → summarize. Inside a script you get web_search, web_extract, read_file, write_file, search_files, patch, and terminal (foreground), each over a Unix-socket RPC back to Hermes. Use it for tool calls with logic between them; use terminal for shell commands. Sandboxed: 300s timeout, 50-call cap, stripped env, no recurse/delegate/MCP. Linux + macOS only.

About these resources. Every command in this video comes from the Code Execution doc.

Sources · What this video distills

1 docs page · every command below traces to one of them
Primary · the from hermes_tools import model, print-only context, in-script tools, RPC socket, limits, security
Code Execution
Read ↗

Commands shown · Copy and paste

each shows the source doc it came from
In-script importfrom source ↗
from hermes_tools import web_search, web_extract
Tune (config.yaml)from source ↗
code_execution.mode: project · timeout: 300 · max_tool_calls: 50

Going deeper · Related Hermes docs

further reading · not sources of facts shown above

Next in the series · Episodes that build on this

E46
Batch Processing
E38
Subagent Delegation
E47
As a Python Library