本文以英文发布。
Why Hermes Agent Burns Tokens and How to Cut Its Prompt to 4K
A one-word hello to Hermes Agent can trigger 30 requests and 1.5M tokens. See where the 16K prompt comes from and which CLI commands trim it below 4,000 tokens.
Picture a fresh Hermes Agent install pointed at an OpenRouter endpoint. A single "hello" goes in, and the dashboard afterwards shows around 30 API requests and close to 1.5 million tokens burned. For a one-word greeting, that's baffling.
On a free endpoint such as Inkling (free), the bill stays at zero. Switch to a paid model like DeepSeek, Claude 3.5 Sonnet or Gemini, though, and those hidden loops can empty an API balance within minutes.
Autonomous agents are powerful, and they're also heavy eaters of tokens. The rest of this piece covers why Hermes carries so much context by default, and how to cut it down hard without losing what makes the agent useful.
Where the bloat comes from
A plain chat window sends your prompt plus a short system message. An agent works differently. It runs a continuous loop of reading, evaluating and executing, and at startup Hermes stuffs a large payload into the prompt window before you've typed a single command.
Running hermes prompt-size shows what a typical input of about 16,000 tokens consists of:
| Component | Rough size | What it is |
|---|---|---|
| Tool schemas | 8,000 to 12,000+ tokens | Dozens of tools are on by default: browser control, subagent delegation, text-to-speech, kanban boards, code sandboxes. The JSON describing how to call each one goes to the model on every turn. |
| Bundled skills | 3,000 to 5,000+ tokens | An index of 50+ procedural playbooks, from reviewing pull requests to writing songs, so the agent knows which workflows it can recall. |
| Plugins and providers | varies | Dozens of plugins for media generators and web scrapers (Brave, Tavily, Searxng and more) each reserve some token budget in case they get called. |
Then there's the multiplier. Agents don't only answer, they think. If Hermes gets stuck in a verification cycle, or never emits a stop token, it may circle 10 to 15 times internally. Every pass resends the whole 16K-plus context, so usage balloons far faster than it first appears.
Putting it on a diet
With a handful of built-in CLI commands, the baseline footprint can fall from roughly 16,000 tokens to under 3,500. The steps go in this order.
1. Remove the bundled skills
Unless Hermes needs to draw architecture diagrams in Manim or triage an email inbox, those 50-plus default skills are just padding. The unmodified bundled ones can be dropped from a profile safely:
hermes skills opt-out --remove
Expect about 1,000 to 1,500 tokens to disappear from the baseline immediately.
2. Turn off toolsets you don't use
If Hermes is only there for software engineering, meaning file edits and terminal commands, the heavy specialized toolsets can go. Delegation (subagents), text-to-speech and the clarification tools all come with large JSON schemas.
hermes tools disable delegation tts code_execution clarify
Tool schema size falls from around 29 KB to roughly 10 KB, which saves 4,000 tokens or more.
3. Disable search and media plugins
Each enabled plugin registers background capability checks. The CLI's disable command takes only one argument at a time, so a small bash loop is the neatest way to switch off every third-party provider that isn't in active use:
for plugin in deepinfra fal krea meta-ai-image-gen xai web-perplexity web-searxng web-tavily web-brave-free; do
hermes plugins disable "$plugin"
done
That stops dozens of external providers from reserving schema budget at runtime.
4. Start minimal sessions when that's enough
For quick, isolated jobs that need neither persistent memory nor skill indexing, the default startup sequence can be skipped by naming the allowed tools at launch:
hermes chat -t terminal,file
Prompt caching does the rest
After trimming, the baseline should settle in a lean range of about 4,000 to 6,000 tokens. That's a good balance between capability and cost. What's left is the core agent instructions, the active project memory (MEMORY.md) and the essential terminal tools.
Zero isn't the target. The facts stored in MEMORY.md, such as paths to Python virtual environments or constraints of the system, are what stop the agent from repeating the same mistakes. Cutting those saves little and costs a lot.
The last piece is prompt caching. On OpenRouter models that support it, the static prefix of every request gets cached. That prefix covers tool schemas, the system prompt and memory files. The dashboard will probably show a cache hit rate above 95% across consecutive turns. Cached tokens are normally discounted by 75% to 90%, so a 6,000-token prompt ends up billed about like one of 500 tokens.
Prune the active tools, lean on caching, and a fully autonomous terminal agent can run for fractions of a cent per turn.