hermes

Compress a prompt

Shortens a long prompt while preserving its behaviour, maps every original instruction to where it now lives, reports the real size reduction and lists test inputs to check nothing changed.

context

Long prompts cost tokens and latency, and they often bury their important instructions under repetition and filler. But a shorter prompt is only better if it behaves the same. Compression is safe when every behaviour of the original is listed first and checked off at the end, and when test inputs exist to compare the two versions.

original prompt

Target reduction:

task
  1. Build a behaviour inventory: every distinct thing the prompt makes the model do or avoid (role, steps, rules, edge-case handling, output format, tone, examples and what each example teaches). Number them B1, B2 and so on.
  2. Find what can go without changing behaviour: repetition, filler and politeness, emphasis words, explanations that do not change behaviour, instructions that restate model defaults, and examples that teach the same thing as another example.
  3. Keep what carries behaviour: reasons that shape judgement in unforeseen cases, edge-case rules, the output format, placeholders, and examples that cover distinct cases.
  4. Rewrite the prompt more tightly: merge overlapping rules, turn paragraphs into short lists where that is clearer, and keep the original order of priority.
  5. Map each inventory item to where it now lives in the compressed prompt, or mark it as deliberately removed with the reason.
  6. Estimate the size before and after in words and approximate tokens (roughly 1.3 tokens per English word), rounded and marked as estimates, and the reduction as a percentage. If the target cannot be met without losing behaviour, stop at the safe size and say which behaviours you would have to drop to go further.
  7. Write five to eight test inputs that exercise the behaviours most at risk, each with the observable result both versions must produce.
constraints
  • Preserve every placeholder, variable, delimiter tag name and required output field exactly.
  • Never drop a safety, privacy or honesty instruction to save space.
  • Do not change what the prompt does. Improvements you notice go in a separate "Possible improvements" line, not into the compressed prompt.
  • You cannot run the tests. Present them for the user to run on both versions side by side.
output format

Behaviour inventory

Numbered list B1, B2...

Compressed prompt

Fenced code block.

Behaviour map

Table: Behaviour | Where it lives now (quote the phrase) or "removed: reason".

What was cut

Bullets: what and why it was safe.

Size

One line: "About N words (~T tokens) → about M words (~U tokens), about P% shorter." If the target was not met, one more line on what would have to go to reach it.

Test inputs

Table: Input | Behaviours tested | Expected in both versions. Possible improvements: one line, or "None".

1 required value still a placeholder; the assistant will ask for it.

details

kind
Prompt: a task you run by name to get one finished thing back
domain
Prompting and assistants
category
Prompt engineering
level
Intermediate
made for
ML / AI engineer, Software engineer, Anyone, personal use
risk
read-only
version
v1.0.0 · incubating
reviewed
2026-10-02
works in
Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md, ChatGPT, claude.ai

Edit on GitHubReport a problem

use in

Hodios CLI
npx @hermes-hq/hodios install compress-prompt --target claude-code
Agent Skills
npx skills add hermes-hq/hodios-dist --skill compress-prompt -a claude-code
Add the Hodios marketplace (once)
claude plugin marketplace add hermes-hq/hodios-dist
Install the prompting plugin
claude plugin install hodios-prompting@hodios

The plugin brings every entry in this domain at once.

PersonaPrompt engineering

Prompt engineer

Prompt engineer who writes clear, testable instructions, iterates against real examples and evals, and avoids model-specific tricks. Use for designing, debugging and maintaining prompts.

prompt-engineer
PromptPrompt engineering

Improve a prompt

Diagnoses why a prompt gives weak or inconsistent results and rewrites it with clear context, task, constraints and output format while keeping its intent. Use on any prompt for any AI assistant.

improve-prompt
PromptPrompt engineering

Diagnose prompt failures

Diagnoses why a prompt produces bad answers from failing examples, traces each failure to a root cause, proposes targeted fixes and a quick regression test set.

diagnose-prompt-failures
PromptPrompt engineering

Adapt a prompt for a reasoning model

Rewrites a prompt for reasoning-capable models by removing step-by-step micromanagement, stating goals, constraints and success criteria, and keeping the output format exact.

adapt-prompt-for-reasoning-model
PromptPrompt engineering

Build a test set for a prompt

Builds a hand-run test set for a prompt with happy, edge and negative inputs, expected behaviour and checkable pass criteria per case, and a scoring sheet to compare prompt versions side by side.

build-prompt-test-set
PromptPrompt engineering

Create few-shot examples

Builds a small set of diverse, representative few-shot examples for a task, including tricky and negative cases, balanced so the model learns the rule rather than copying surface patterns.

create-few-shot-examples