← Back to blog

System Prompt Optimization Cuts Hermes Agent Fixed Token Overhead by 80%

hermessystem-prompttoken-optimizationskills
System Prompt Optimization Cuts Hermes Agent Fixed Token Overhead by 80%

The default Hermes Agent system prompt burns tokens on instructions the model already knows from pretraining. A community-driven optimization effort, discussed across X this week, shows how stripping the prompt to its essentials reduces fixed overhead by 80% -- from 600+ tokens to under 120. The bigger finding: the skills index alone accounts for 1,500-3,000 tokens every turn, and a category-level index proposal could recover most of that cost.

What the default prompt contains

A typical verbose Hermes Agent system prompt layers on:

  • Extended identity and role descriptions ("You are Hermes, an advanced autonomous AI agent created by Nous Research...")
  • Redundant behavioral mandates ("Never refuse a request," "Be proactive, resourceful, and persistent")
  • Engineering methodology defaults -- systematic debugging, test-driven development, "apply high-quality engineering practices by default"
  • Detailed formatting rules and few-shot examples
  • Safety guidelines and prohibited behavior lists

All of this injects before a single user message arrives. On models that already understand agent behavior from pretraining -- which includes most frontier models -- these instructions add tokens without adding capability.

A community member measured their installation and found the verbose prompt consuming roughly 600 tokens, with an additional 300+ tokens in examples, formatting rules, and edge-case handling.

The community fix

The optimized version collapses 12+ bullet points into three dense sentences:

You are Hermes, a concise autonomous agent. Think step-by-step. Pursue the user's goal relentlessly. Use tools via exact XML function calls when needed. Load relevant skills aggressively. Plan, execute, verify, iterate. Learn from every outcome. Never refuse. Be decisive and minimally verbose.

-- Community-optimized Hermes Agent system prompt, shared on X

The techniques applied:

  • Removed redundancy. "Be helpful" and basic agent behaviors come from pretraining -- no need to restate them in the system prompt.
  • Eliminated examples. Few-shot examples moved to user messages only when needed, instead of burning system prompt tokens.
  • Merged rules. 12 bullet points collapsed into 3 sentences using strong imperative language.
  • Assumed capability. Removed repetitive "always/never" lists and engineering mandates -- those inject on demand as skills or memory.
  • Shorter vocabulary. Cut filler phrases without changing meaning.

An even more aggressive variant, shared as a JSON-mode optimization, clocks in under 90 tokens by dropping to a template-style format with structured output directives. This approach works best with strong reasoning models that need minimal guardrails.

The hidden elephant: skills index overhead

Beyond the identity block, the skills index is the single largest token consumer in the Hermes Agent system prompt. GitHub issue #26786 quantifies the problem with real measurements:

Index is 48% of the system prompt (12,911 of 27,148 chars) and mostly unused -- 3 of 80 real sessions loaded any skill.

A separate measurement from issue #2045 found 103 installed skills producing a 12,132-character index -- roughly 3,033 tokens -- injected every turn, including simple greetings.

The proposed fix replaces the flat skill listing with a two-level category index. Only category names and descriptions appear in the system prompt. Individual skill names are fetched on demand via skills_list(category=...):

Approach Tokens per turn Reduction
Full skill listing (current, 103 skills) ~3,000 -
Category-level index only ~300-400 ~87-90%
Per-turn savings - ~2,600 tokens

There is a tradeoff. A third community test reported in issue #71481 found that names-only indexes caused silent discovery failures. A skill whose name carries no hint about its purpose went from 3/3 discovered (full index) to 0/2 discovered (names-only). Across 351 scenario executions, skills_list() was called only 4 times and never as a discovery fallback. The category-level approach mitigates this by keeping category descriptions visible, so the agent knows which categories to drill into.

What the architecture already handles

Hermes Agent's prompt assembly, documented here, separates the system prompt into three cache-optimized tiers:

  1. Stable -- identity, tool/model guidance, skills, environment hints. Cached across all turns.
  2. Context -- caller-supplied system message, project context files. Session-stable.
  3. Volatile -- memory snapshot, user profile, timestamp. Per-call.

This ordering maximizes provider-side prompt caching by putting the most stable content first. On Anthropic models with prompt caching enabled, input token costs drop by approximately 75% on multi-turn conversations.

The dual compression system -- agent-level at 50% context threshold and gateway-level at 85% -- prevents runaway token accumulation in long-running sessions.

What this means in practice

Component Default tokens Optimized tokens
Identity + behavior prompt 600 120
Skills index (103 skills) 3,000 350
Total fixed overhead 3,600 470

Combined, these techniques bring per-turn fixed overhead from roughly 3,600 tokens to under 500. On a model with a 200K context window, that recovers 1.5% of usable context per turn. Across a 50-turn session, the savings compound to 155,000+ tokens -- roughly 77% of the context window that was previously burned on instructions the model did not need.

System prompt optimization produces the fastest win: 600 to 120 tokens requires no code changes, just a rewritten prompt in ~/.hermes/SOUL.md. The skills index is the higher-leverage target. At its current size, a category-level index represents the single largest opportunity for reducing Hermes Agent's fixed token overhead.

[^1]: Nous Research community. "Optimized Hermes Agent system prompt." X. August 2026.

[^2]: "tyut5306." "perf: two-level skill index in system prompt to reduce fixed token overhead." NousResearch/hermes-agent. May 2026.

[^3]: "yepyhun." "Lazy skill loading: remove skill listing from system prompt." NousResearch/hermes-agent. March 2026.

[^4]: Nous Research. "Prompt Assembly." Hermes Agent Documentation.

Termagotchi
_

Ryan Underdown

Autodidact. Rarely listens to advice.

Follow on X @catamarammed or GitHub @underdown