fbpx

Hermes Compaction: How Hermes Shrinks Long Chats (and the New Prepare-Ahead Option)

WANT TO BOOST YOUR SEO TRAFFIC, RANK #1 & Get More CUSTOMERS?

Get free, instant access to our SEO video course, 120 SEO Tips, ChatGPT SEO Course, 999+ make money online ideas and get a 30 minute SEO consultation!

Just Click The Button Below To Get FREE, Instant Access!

Hermes compaction is how Hermes Agent keeps a long conversation going without running out of room. When a chat gets close to the model’s context limit, Hermes summarises the older part and keeps the recent messages word for word. The stable v0.22.6 release on 2 November 2026 shipped a new opt-in setting, compression.prepare_ahead, which writes the next summary in the background so compaction doesn’t pause your chat. Below is when compaction fires, the settings worth changing, how to run it by hand, and when to turn on prepare-ahead. My video is right under this intro.

Key takeaways

  • Compaction fires at 50% of the context limit by default (compression.threshold: 0.50).
  • It keeps a recent tail and pins your first 3 messages, so the original goal stays visible.
  • Run it by hand with /compress; old turns are archived, not deleted, and stay searchable.
  • New: prepare_ahead: true writes the next summary in the background. Off by default.
  • Want long-running AI agents for your business? Claim a free strategy session.

What is compaction in Hermes?

Every model has a context window: the most text it can read at once. A long chat with tool output fills it fast. The configuration docs explain that Hermes automatically compresses long conversations to stay inside that window, using a separate summary call that you can point at any provider.

Two things make it safe to leave on:

  • It works in place by default (in_place: true), so the chat keeps one session ID instead of splitting into “#2”, “#3” copies.
  • It’s non-destructive: older turns are soft-archived under the same ID, still searchable with session_search and recoverable.

When Hermes compaction fires

The main settings, with their defaults from the docs:

Setting Default What it does
threshold 0.50 Compress at this share of the context limit
threshold_tokens off Optional fixed token cap; Hermes uses whichever comes first
tail_mode lean How much recent chat stays word for word
protect_last_n 20 Minimum recent messages kept uncompressed
protect_first_n 3 Opening messages pinned through every compaction
idle_compact_after_seconds 0 (off) Compact a chat you return to after a long gap

threshold_tokens is handy on big-window models. The docs’ example is threshold_tokens: 256000 to compact a 1M-token model at 256K instead of 500K, which keeps every call cheaper.

Want AI agents that handle long jobs without falling over? Inside the AI Profit Boardroom you get the Agent OS — Hermes, OpenClaw, OpenCode, Claude and Codex in one place — plus step-by-step Hermes training and four live coaching calls a week.

Want a plan for your business first? Claim your free strategy session.

Join the AI Profit Boardroom →Claim Your Free SEO Strategy Session →

How to compact a chat by hand

Type /compress in the chat to run compaction right now, for example before you switch to a big new task in the same thread. Automatic compaction is silent on Telegram, Discord and Slack by default; set progress_notices: true if you want to see the “Compacting context…” notices there.

Editing any compression.* setting on a running gateway takes effect on the next message. No restart needed.

Easier option: ask your agent, “Show my compression settings, then set compaction to fire at 256K tokens.”

The new prepare_ahead option

Normally the summary is written at the moment compaction fires, so a long chat can pause while it happens. The prepare-ahead change (merged 25 October, in the stable v0.22.6 release on 2 November) writes it early instead:

compression:
  prepare_ahead: true
  • Once the chat is close to the trigger, Hermes writes the next summary in the background while tools run and between turns.
  • When compaction fires and the summarised messages haven’t changed, the prepared summary is used straight away.
  • If it’s still being written, compaction waits for it instead of starting again.
  • If it no longer matches (a dropped message or a rewind), compaction just runs the normal way.

The trade-off: it spends an extra summary call that may go unused. It doesn’t apply to manual /compress, plugin context engines, or native compaction, and it switches itself off after the first compaction if your memory provider adds context to summaries.

Use a cheaper model for summaries

The summary call uses your main model unless you change it. Point it at a faster model to save time:

auxiliary:
  compression:
    provider: openrouter
    model: google/gemini-3-flash-preview

You can also set a custom OpenAI-compatible endpoint with base_url. Subagents have their own trigger too: delegation.compression_threshold_tokens caps when a child agent compacts.

Want this set up for you instead of doing it yourself? Claim your free strategy session →

Claim Your Free SEO Strategy Session →

The no-AI tool-result prune

On big-window models, compaction at 50% may rarely fire, so bulky terminal dumps and file reads get re-sent on every turn. proactive_prune_tokens (off by default; the docs suggest trying 48000) removes duplicate tool results and shortens old oversized ones without calling the model, and never touches your recent messages.

My verdict

Leave compaction on, set threshold_tokens if you use a 1M-token model, and turn on prepare_ahead if your long chats pause while they compress. That’s the simple setup for Hermes compaction.

About Julian Goldie

I’m Julian Goldie — founder of Goldie Agency and the AI Profit Boardroom. I test new AI agents almost every day for 432K+ YouTube subscribers and run Hermes, OpenClaw, OpenCode, Claude and Codex side by side in my own Agent OS. Claim your free strategy session or join the AI Profit Boardroom.

Want another angle? Read the AI Profit Boardroom guide to Hermes Compaction.

FAQ: hermes compaction

What is Hermes compaction?

It is how Hermes Agent summarises the older part of a long chat when it nears the model’s context limit, keeping recent messages word for word so the conversation can continue.

When does Hermes compress a conversation?

By default at 50% of the model’s context limit (compression.threshold: 0.50). You can also set an absolute cap with threshold_tokens, and Hermes uses whichever comes first.

Does compaction delete my old messages?

No. With the default in-place mode, older turns are soft-archived under the same session ID and stay searchable with session_search.

How do I compact a Hermes chat manually?

Type /compress in the chat. Manual compaction runs straight away and does not use the prepare_ahead option.

What does prepare_ahead do?

It writes the next compaction summary in the background once a chat is close to the trigger, so compaction can use it instantly. It shipped in the stable v0.22.6 release on 2 November 2026 and is off by default.

Can I use a cheaper model for compaction?

Yes. Set auxiliary.compression.provider and model in config.yaml, or a custom base_url, and summaries run on that model instead of your main one.

Ready to put Hermes to work in your business? Join the AI Profit Boardroom for the Agent OS, setup training and daily updates.

Or claim your free strategy session and we’ll map out your setup.

Starting from zero? Get the free AI course and community.

Join the AI Profit Boardroom →Claim Your Free SEO Strategy Session →Get the FREE AI Course + Community →

Related reading

Last updated November 2026. This page is a living guide to hermes compaction — the facts here move fast and it is updated as they do.

Picture of Julian Goldie

Julian Goldie

Hey, I'm Julian Goldie! I'm an SEO link builder and founder of Goldie Agency. My mission is to help website owners like you grow your business with SEO!

Leave a Comment

WANT TO BOOST YOUR SEO TRAFFIC, RANK #1 & GET MORE CUSTOMERS?

Get free, instant access to our SEO video course, 120 SEO Tips, ChatGPT SEO Course, 999+ make money online ideas and get a 30 minute SEO consultation!

Just Click The Button Below To Get FREE, Instant Access!