Source profileQuality 95/100Review permissions

moonlight-lupin/agent-skills/agent-ops/input-token-overheads/SKILL.md

input-token-overheads

Use when context window is filling up too fast or input token cost is too high. Audits overhead sources.

Source repository stars
16
Declared platforms
0
Static risk flags
2
Last source update
2026-08-26
Source checked
2026-08-26

Decision brief

What it does: where it fits

Audit every source of per-turn input token cost on a Hermes Agent instance. Measure each, rank by cost, act on the top consumers.

Best for

  • User says "token overhead", "context too large", "why is input so expensive"
  • Model output quality degrades from context dilution
  • Cost optimization — fewer input tokens per turn means lower API spend

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/moonlight-lupin/agent-skills --skill "agent-ops/input-token-overheads"
Safe inspection promptEditorial

Inspect the Agent Skill "input-token-overheads" from https://github.com/moonlight-lupin/agent-skills/blob/78aee69209dc94cb90d5bed4fa8e2f3bfbb993ee/agent-ops/input-token-overheads/SKILL.md at commit 78aee69209dc94cb90d5bed4fa8e2f3bfbb993ee. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Procedure

    Run the audit script to get real numbers:

    Run the audit script to get real numbers:bash python3 -c " import yaml, pathlib, glob, os, re
  2. 02

    Verification

    Re-run audit script — confirm token estimates dropped

    Re-run audit script — confirm token estimates droppedhermes tools — confirm only needed toolsets enabledMemory block — confirm under budget
  3. 03

    When to Use

    User says "token overhead", "context too large", "why is input so expensive"

    User says "token overhead", "context too large", "why is input so expensive"Model output quality degrades from context dilutionCost optimization — fewer input tokens per turn means lower API spend
  4. 04

    The Overhead Map

    Every turn, Hermes injects these blocks into the system prompt before the user's message:

    Every turn, Hermes injects these blocks into the system prompt before the user's message:On-demand (not per-turn): full SKILL.md via skillview, deferred tool schemas via tooldescribe, reference files via skillview(filepath=...).
  5. 05

    Health Ratio

    The health metric is overhead ratio: overhead tokens divided by the model's context window. The absolute number matters for cost; the ratio matters for quality.

    Lost in the Middle (Liu et al., TACL 2023) — Models follow a U-shaped curve: best recall at the start and end of context, severe degradation in the middle. Overhead sits at the top of every turn, but it pushes conversat…Same Task, More Tokens (Levy et al., ACL 2024) — Reasoning performance degrades at input lengths far shorter than the model's stated maximum. The degradation appears even when the extra tokens are padding with no distra…Context Length Alone Hurts (Du et al., EMNLP 2025) — Performance degrades 14-85% as input length increases, even when retrieval is perfect, irrelevant tokens are replaced with whitespace, or all tokens except relevant o…

Permission review

Static risk signals and limitations

Runs scripts

medium · line 67

The documentation asks the agent to run terminal commands or scripts.

Run the audit script to get real numbers:

Runs scripts

medium · line 70

The documentation asks the agent to run terminal commands or scripts.

python3 -c "

Reads files

low · line 78

The documentation asks the agent to read local files, directories, or repositories.

text = pathlib.Path(f).read_text()

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score95/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars16SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
moonlight-lupin/agent-skills
Skill path
agent-ops/input-token-overheads/SKILL.md
Commit
78aee69209dc94cb90d5bed4fa8e2f3bfbb993ee
License
MIT
Collected
2026-08-26
Default branch
main
View the original SKILL.md

Input Token Overheads

Audit every source of per-turn input token cost on a Hermes Agent instance. Measure each, rank by cost, act on the top consumers.

When to Use

  • User says "token overhead", "context too large", "why is input so expensive"
  • Model output quality degrades from context dilution
  • Cost optimization — fewer input tokens per turn means lower API spend
  • After adding skills, plugins, or tools — verify the overhead delta

The Overhead Map

Every turn, Hermes injects these blocks into the system prompt before the user's message:

BlockWhen loadedCost model
Skill descriptionsEvery turn (skill-retrieval top-K)~200 chars per description, K per turn
Memory (personal notes)Every turnStatic, grows with usage
User profileEvery turnStatic, grows as preferences accumulate
Memory provider contextEvery turn (if memory plugin active)Dynamic, 5 memories recalled by default
Tool schemas (direct)Every turnFull JSON schema per enabled tool
Deferred tool catalogEvery turn (if configured)Name + description only
Mandatory skillsEvery turn (if configured)Full SKILL.md body
Platform formatting rulesEvery turnFixed, platform-specific
Behavioral rulesEvery turnFixed system prompt text
Full skill bodyOn-demand (skill_view)Only when a skill is loaded
Compression summaryAfter thresholdReplaces older messages with a summary

On-demand (not per-turn): full SKILL.md via skill_view, deferred tool schemas via tool_describe, reference files via skill_view(file_path=...).

Health Ratio

The health metric is overhead ratio: overhead tokens divided by the model's context window. The absolute number matters for cost; the ratio matters for quality.

RatioRatingNotes
< 5%ExcellentMost of the window available for conversation
5-15%HealthyNormal for a capable agent with tools, skills, memory
15-25%AcceptableApproaching the limit. Consider trimming.
> 25%UnhealthyEats conversation capacity. Cost and quality risk.

Why the ratio matters: Three studies confirm that input length degrades model performance independent of content quality:

  1. Lost in the Middle (Liu et al., TACL 2023) — Models follow a U-shaped curve: best recall at the start and end of context, severe degradation in the middle. Overhead sits at the top of every turn, but it pushes conversation history into the degradation zone. arxiv.org/abs/2307.03172

  2. Same Task, More Tokens (Levy et al., ACL 2024) — Reasoning performance degrades at input lengths far shorter than the model's stated maximum. The degradation appears even when the extra tokens are padding with no distracting content. The model's technical context window is not its effective context window. aclanthology.org/2024.acl-long.818

  3. Context Length Alone Hurts (Du et al., EMNLP 2025) — Performance degrades 14-85% as input length increases, even when retrieval is perfect, irrelevant tokens are replaced with whitespace, or all tokens except relevant ones are masked. The sheer length of the input is itself a limitation. aclanthology.org/2025.findings-emnlp.1264

Cost compounding: Overhead is paid every turn. At 10k tokens over 100 turns, that is 1M input tokens spent on overhead alone. Reducing overhead by 2k tokens saves 200k tokens per 100-turn session.

Mitigations from the research:

FindingSourceAction
Models recall start and end of context best; middle degradesLiu et al. 2023Keep overhead at the top (Hermes already does this). Avoid pushing critical conversation history into the middle — lower compression threshold if history is being compressed too aggressively
Reasoning degrades well below the stated context window maximumLevy et al. 2024Treat the effective context window as 50-70% of the advertised maximum. Target an overhead ratio under 10% of the advertised window, not the effective one
Sheer input length hurts even with perfect retrieval and no distractionDu et al. 2025Reduce overhead aggressively. Every 1k tokens of overhead removed improves reasoning quality, not just cost. The study's mitigation: prompt the model to recite key evidence before solving — equivalent to Hermes compression summarizing relevant context
Tool calling degrades 7-85% as tool catalog grows from 8k to 120k tokensLongFuncEval (arxiv 2505.10570)Keep the enabled toolset count low. Prefer deferred tools (loaded on demand) over always-on schemas. Disable unused toolsets

Procedure

1. Measure each overhead source

Run the audit script to get real numbers:

python3 -c "
import yaml, pathlib, glob, os, re

# --- Skill descriptions (skill-retrieval index) ---
files = glob.glob(os.path.expanduser('~/.hermes/skills/**/SKILL.md'), recursive=True)
total_desc = 0; count = 0; by_cat = {}
for f in files:
    try:
        text = pathlib.Path(f).read_text()
        m = re.match(r'^---\n(.*?)\n---\n', text, re.DOTALL)
        if not m: continue
        fm = yaml.safe_load(m.group(1))
        if not fm: continue
        desc = fm.get('description', '')
        if not desc: continue
        cat = f.split('/skills/')[1].split('/')[0]
        by_cat.setdefault(cat, [0,0]); by_cat[cat][0] += len(desc); by_cat[cat][1] += 1
        total_desc += len(desc); count += 1
    except Exception: pass
avg = total_desc // max(count, 1)
K = int(os.environ.get('SKILL_RETRIEVAL_TOP_K', '6'))
print(f'Skills: {count} total, {total_desc} chars in descriptions')
print(f'  Top-K per turn: ~{K*avg} chars (~{K*avg//4} tokens) at K={K}')
print(f'  By category (top 5):')
for cat, (sz, cnt) in sorted(by_cat.items(), key=lambda x: -x[1][0])[:5]:
    print(f'    {sz:>6} chars ({cnt:>2} skills) {cat}')

# --- Disabled skills (savings) ---
config_path = os.path.expanduser('~/.hermes/config.yaml')
if not os.path.exists(config_path):
    print('  Config: ~/.hermes/config.yaml not found — skipping disabled/compression stats')
else:
    try:
        with open(config_path) as fh:
            cfg = yaml.safe_load(fh)
        if cfg is None:
            cfg = {}
        disabled = cfg.get('skills',{}).get('disabled',[]) or []
        print(f'  Disabled: {len(disabled)} skills (saves ~{len(disabled)*avg} chars)')
        comp = cfg.get('compression',{}) or {}
        print(f'  Compression: threshold={comp.get(\"threshold\")}, target_ratio={comp.get(\"target_ratio\")}, protect_last={comp.get(\"protect_last_n\")}')
    except Exception as e:
        print(f'  Config parse error: {e}')
"

For memory provider counts (if Mnemosyne is installed):

python3 -c "
import sqlite3, os, glob
for db in glob.glob(os.path.expanduser('~/.hermes/**/mnemosyne.db'), recursive=True):
    conn = sqlite3.connect(db); c = conn.cursor()
    for t in ['working_memory','episodic_memory','canonical_facts','memoria_facts']:
        try:
            c.execute(f'SELECT COUNT(*) FROM {t}'); print(f'  {t}: {c.fetchone()[0]} rows')
        except: pass
    conn.close()
"

Done: skill descriptions, disabled count, and compression config measured. Tool schemas (#1) and behavioral rules (#2) are fixed costs — estimate from the model's system prompt or check /tokens in-session for the total. The script measures the variable sources (#6, #7); the fixed sources (#1-#5) require in-session inspection.

2. Rank by cost

Sort all sources by tokens per turn. The typical ranking:

  1. Tool schemas — largest fixed cost. Scales with enabled toolset count.
  2. Behavioral rules + system prompt — fixed text.
  3. Mandatory skills — full SKILL.md body per mandatory skill.
  4. Memory + user profile — static blocks.
  5. Deferred tool catalog — name + description per deferred tool.
  6. Skill descriptions — skill-retrieval top-K injection.
  7. Memory provider context — dynamic recall, 5 by default.

Done: sources ranked. Top 3 are the optimization targets.

3. Act on top consumers

Tool schemas (largest fixed cost):

  • Audit enabled toolsets: hermes tools in the dashboard
  • Disable unused toolsets (each removes 1-3 tool schemas from every turn)
  • Use platform_toolsets.cli in config.yaml to control per-profile toolset access
  • Prefer deferred tools (loaded on demand) over always-on tools

Memory blocks:

  • Load skill_view(name='hermes-compression-tuning') for compression tuning
  • Prune memory entries that are stale or duplicated
  • Keep the memory block under its budget — if full, batch-remove stale entries before adding new ones

Skill descriptions:

  • Disable unused skills in config.yaml under skills.disabled — each removed skill saves ~200 chars from the retrieval index
  • Keep descriptions concise — the skill-retrieval plugin truncates at 200 chars. Descriptions over 200 chars waste tokens without improving routing

Memory provider (if installed):

  • Run consolidation to move working to episodic, reducing the working set
  • Invalidate stale facts
  • Lower the recall limit parameter if context is tight

Done: at least one optimization applied to each top-3 source.

4. Verify the delta

Re-run the audit script from step 1. Compare token estimates before and after.

Done: before/after delta reported. If no meaningful reduction, the remaining overhead is structural (system prompt + behavioral rules) and cannot be reduced without config changes.

Pitfalls

ProblemCauseFix
Audit script returns 0 skillsSkills path is wrong or ~/.hermes/skills/ is emptyCheck ls ~/.hermes/skills/ exists and contains category subdirectories. If skills are symlinked or on a custom path, adjust the glob
Disabling a toolset breaks a workflowA skill depends on that toolsetCheck requires_toolsets in the skill's frontmatter before disabling
Memory pruning removes a needed factAggressive removal without checking last-usedCheck recall_count and last_recalled before removing
Compression triggers too earlythreshold set too lowRaise it for longer context windows, but watch for quality degradation
Compression triggers too latethreshold set too highLower it — but compression summaries themselves cost tokens
Mandatory skill overhead seems unavoidableIt is configured in behavioral rulesAccept the cost, or remove the mandatory load requirement in config

Verification

  • Re-run audit script — confirm token estimates dropped
  • hermes tools — confirm only needed toolsets enabled
  • Memory block — confirm under budget
  • Memory provider counts — confirm working set reduced after consolidation
  • Monitor next session: quality should not degrade from reduced context

Frequently asked questions

What to verify before installation and use

What does the input-token-overheads source document cover?

Audit every source of per-turn input token cost on a Hermes Agent instance. Measure each, rank by cost, act on the top consumers.

How do I install input-token-overheads?

The source record exposes this install command: npx skills add https://github.com/moonlight-lupin/agent-skills --skill "agent-ops/input-token-overheads". Inspect the command and pinned source before running it.

Which permission-related actions were detected?

Static rules flagged exec-script, read-files in the source; the page lists the matching lines and excerpts.