The 50% Threshold: Why That Number

+15 Mana ✨

Introduction

Hermes triggers automatic compression when the conversation buffer reaches 50% of the available context. That specific number is not arbitrary; it is a designed default that favors keeping sessions cheap and fast over preserving every verbatim turn. Understanding the logic behind 50% helps you decide when (and whether) to override it.

Key Concepts

  • Compression threshold: The fraction of context utilization at which Hermes triggers automatic compression. Default: 0.50.
  • Per-turn cost: Every turn pays for the whole buffer, so compressing earlier keeps each subsequent turn cheap.
  • Headroom: The remaining 50% provides plenty of space for the compression call, the next user message, and incoming tool output.
  • Soft warning: The status bar suggests /compress once context reaches roughly 95% utilization, which is the late-stage safety net rather than the trigger.

Real World Context

A team runs a long agentic workflow that involves frequent large tool outputs. Compressing at 90% would mean a few enormous turns sit in the buffer and bill on every subsequent message. Compressing at 50% means the verbose tool result is summarized while it is still cheap to summarize, and the next 30 turns ride on a lean buffer. The default favors that pattern.

Deep Dive

Why 0.50 specifically? Three forces shape the default:

  1. Per-turn cost discipline: A buffer at 50% is cheaper than a buffer at 85% on every turn that follows. Compressing earlier compounds the savings across many later turns.
  2. Headroom for incoming load: Tool outputs, large pastes, and tool-call traces can land at any moment. Triggering at 50% means a 20K-token paste does not push the buffer past the hard model limit.
  3. Cheap summarization: Producing a summary is itself a model call that pays for the buffer it summarizes. Summarizing a 50% buffer is cheaper than summarizing a 90% one.

The trade-off is honest: 50% means you lose verbatim detail earlier than a higher threshold would. For most workloads that is the right trade because the model rarely needs literal recall of a turn from twenty turns ago; it needs the gist plus the recent verbatim turns. The compression flow preserves recent turns intact and replaces only the older ones with a summary.

You can override the default in ~/.hermes/config.yaml:

  • Higher threshold (e.g., 0.75): Useful only if your sessions are short and you want maximum verbatim recall. Pays more per turn in the late session.
  • Lower threshold (e.g., 0.35): Rarely useful; you start summarizing while early turns are still actively in use.

Independent of the threshold, the status-bar warning at ~95% utilization is the system's last-line nudge to run /compress manually. By that point automatic compression has likely already fired at least once during a long session.

Common Pitfalls

  1. Assuming higher threshold equals more savings: It does the opposite for sessions that continue beyond the threshold. Higher means more tokens billed on every subsequent turn.
  2. Treating 0.95 as the trigger: The 95% mark is the status-bar warning, not the auto-trigger. Automatic compression happens at the configured threshold, which defaults to 0.50.

Best Practices

  1. Leave the default alone for most workloads: 0.50 is well-suited to long, tool-heavy sessions that are the common Hermes pattern.
  2. If you do tune it, instrument first: Log a few sessions, see when compression actually fires, then decide if higher or lower would help.

Summary

  • The default compression threshold is 0.50, expressed as a fraction of context utilization.
  • The 50% default favors cheap, fast long-running sessions over verbatim recall of older turns.
  • Recent turns are preserved verbatim by the compression flow; only older turns become a summary.
  • The status bar warns at roughly 95% utilization as a safety net, but the auto-trigger is the configured threshold.

Code Examples

yaml
# ~/.hermes/config.yaml
compression:
  enabled: true
  threshold: 0.50           # default; trigger compression at 50% context utilization
  # threshold: 0.75         # less aggressive; more verbatim recall, higher per-turn cost
  # threshold: 0.35         # more aggressive; rarely worth it
✓ Completed