compress-prompt

compress-prompt is a command for coding agents from ofershap/prompt-compression. It costs 16 tokens per session (434 once invoked), scanned A, original, MIT.

A command for turning documentation or prompts into a compact format suitable for AGENTS.md. It can produce indexes, rules, configuration notes, and API references in token-efficient form.

In plain words
What is it for?
Compressing framework documentation, coding standards, API references, configuration details, or mixed project guidance.
Why use it?
It helps fit useful project guidance into less context, so coding agents can access more instructions without making prompts unnecessarily large.

Command

Part of the prompt-compression plugin — 1 skill, 2 commands shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/ofershap/prompt-compression/compress-prompt
Clone the repo
git clone --depth 1 https://github.com/ofershap/prompt-compression

Or install prompt-compression, the plugin that ships this one along with the rest of its 1 skill, 2 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for compress-prompt

README.md
[![agentmods](https://agentmods.dev/badge/commands/ofershap/prompt-compression/compress-prompt.svg)](https://agentmods.dev/commands/ofershap/prompt-compression/compress-prompt)
Your own site
<a href="https://agentmods.dev/commands/ofershap/prompt-compression/compress-prompt"><img src="https://agentmods.dev/badge/commands/ofershap/prompt-compression/compress-prompt.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 434 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00016 $0.00434
Opus 5 $0.00008 $0.00217
Sonnet 5 $0.00003 $0.00087
Haiku 4.5 $0.00002 $0.00043

Measured 4d ago against content hash 6c6910cdbf1a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

compress-prompt scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/compress-prompt.md · 47 lines

What it actually says

Compress the provided content into a compact, token-efficient format suitable for AGENTS.md or CLAUDE.md.

Use the prompt-compression skill for compression techniques and output formats.

When a file or content is provided

  1. Identify content type: docs index, coding standards, API reference, config/schema, or mixed
  2. Extract actionable content: strip prose, motivation, history, redundant examples
  3. Apply compression:
    • Pipe-delimited index for file trees
    • Single-line directives for rules and standards
    • Abbreviated keys for config and schema
    • Brace expansion for grouped items
  4. Add retrieval directive if output references readable files
  5. Show before/after token count (estimate: 1 token per 4 characters)
  6. Present the compressed output in a fenced code block ready to paste into AGENTS.md

When no file or content is provided

Guide the user through the process:

  1. Ask what they want to compress:

    • "What content do you want to compress for AGENTS.md? Options:"
    • a) Framework docs - point me to the docs directory or framework name
    • b) Project coding standards - paste or point me to your guidelines
    • c) API reference - share your API docs or OpenAPI spec
    • d) Existing AGENTS.md - I'll audit and compress what you have
    • e) Other - describe what you want to compress
  2. Once the user provides content, proceed with the compression steps above.

Quality checks

After compression, verify:

  • Every file or section from the original is still reachable in the compressed version
  • No actionable information was lost
  • Token reduction is at least 60%
  • Output is valid markdown that can be pasted directly into AGENTS.md
  • Retrieval-led reasoning directive is included (if referencing files)
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 47 lines · 16 tokens per session scan A 6c6910cdbf1a

Subscribe to this mod's changes

compress-prompt is a command published in the GitHub repository ofershap/prompt-compression (1 stars, last pushed 6mo ago), licensed MIT. It adds 16 tokens to every session and 434 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.