prompt-compressor

prompt-compressor is a skill for Claude Code from hackermanishackerman/claude-skills-vault. It costs 46 tokens per session (1,177 once invoked), scanned A, original, MIT.

A guide for shortening detailed prompts and background context before an AI model processes them.

In plain words
What is it for?
Use it to compress prompts containing long files, repeated explanations, or more than 1,500 tokens, with commands such as /compress-prompt or /cp.
Why use it?
It removes repetition and irrelevant wording when a prompt is long, helping keep the important request and context within the available input space.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it to compress prompts containing long files, repeated explanations, or more than 1,500 tokens, with commands such as /compress-prompt or /cp.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hackermanishackerman/claude-skills-vault/prompt-compressor
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.

Any agent
npx skills add hackermanishackerman/claude-skills-vault --skill prompt-compressor
Clone the repo
git clone --depth 1 https://github.com/hackermanishackerman/claude-skills-vault

Made for: Claude Code.

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 prompt-compressor

README.md
[![agentmods](https://agentmods.dev/badge/skills/hackermanishackerman/claude-skills-vault/prompt-compressor.svg)](https://agentmods.dev/skills/hackermanishackerman/claude-skills-vault/prompt-compressor)
Your own site
<a href="https://agentmods.dev/skills/hackermanishackerman/claude-skills-vault/prompt-compressor"><img src="https://agentmods.dev/badge/skills/hackermanishackerman/claude-skills-vault/prompt-compressor.svg" alt="Measured on agentmods" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,177 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00046 $0.01177
Opus 5 $0.00023 $0.00589
Sonnet 5 $0.00009 $0.00235
Haiku 4.5 $0.00005 $0.00118

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

Security

Grade A, and why

prompt-compressor 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 8d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/compress_prompt.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

.claude/skills/prompt-compressor/SKILL.md · 172 lines

How it starts

The opening of the file, as written. The whole thing — 172 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Prompt Compressor

Compress verbose prompts/context before processing. Saves 40-60% tokens.

When to Use

Invoke when:

  • Input >1500 tokens
  • User pastes entire files (needs only sections)
  • Prompts have redundant phrasing
  • Context includes irrelevant info
  • Commands: /compress-prompt, /cp

Process

  1. Identify core intent - What user actually wants
  2. Extract essential context - Only what's needed
  3. Remove redundant phrases - See rules below
  4. Apply abbreviations - Use token-formatter conventions
  5. Output compressed version - w/ token savings %

Compression Rules

Remove Phrases

Remove Transform To
"Please help me with" (delete)
"I need you to" (delete)
"Could you please" (delete)
"I would like to" (delete)
"I think", "Maybe", "Perhaps" (delete)
"This might be a dumb question" (delete)
"As I mentioned before" (delete)
"For your reference" (delete)

Transform Patterns

Verbose Compressed
"I want to create a fn that takes X and returns Y" fn(X) → Y
"The error message says..." Error: ...
"In the file located at..." File: ...
"I'm trying to..." Goal: ...
"Here is my code..." Code:
"The problem is that..." Issue: ...

Never Compress (Security)

See references/never_compress.md for full list:

  • Auth headers, tokens, credentials
  • Error stack traces (keep full)
  • Security-related context
  • API keys, secrets
  • Exact error messages
  • File paths in errors

Output Format

## Compressed Prompt

[Compressed content]

---
Original: X tokens | Compressed: Y tokens | Saved: Z%

Examples

Example 1: Verbose Request

Before (847 tokens):

Hello! I hope you're doing well today. I was wondering if you could please
help me with something. I'm trying to build a React application and I need
to create a custom hook that fetches user data from an API. The API is
located at /api/users and it returns a JSON response with the user object.
I would like the hook to handle loading states, error states, and also
cache the response. I think this might need to use useEffect and useState
but I'm not entirely sure about the best approach. Could you please help
me implement this? Here is some context about my project structure...
[500 more tokens of context]

Read the full file on GitHub · 172 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 172 lines · 46 tokens per session scan A 6a9fb843ea8f

Subscribe to this mod's changes

prompt-compressor is a skill published in the GitHub repository hackermanishackerman/claude-skills-vault (2 stars, last pushed yesterday), licensed MIT. It adds 46 tokens to every session and 1,177 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

implementing-llm-guardrails-for-security

Implements input and output validation guardrails for LLM-powered applications to prevent prompt injection, data leakage, toxic content generation, and hallucinated outputs. Builds a security validation pipeline using NVIDIA NeMo Guardrails Colang definitions, custom Python validators for PII detection and content…

xalgorix/xalgorix · 143 tokens

prompting

Guide for writing effective system prompts for LLM agents. Use when creating or editing system prompts for applications, agent configurations, or development tools.

saffron-health/libretto · 31 tokens

few-shot-examples

Curated few-shot examples for construction AI tasks: classification, extraction, analysis. Domain-specific examples for improved LLM performance.

datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction · 30 tokens

prompt-templates

Reusable prompt templates for construction AI tasks: cost estimation, schedule analysis, document processing, BIM queries. Structured prompts for consistent results.

datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction · 30 tokens

opik-optimizer

Optimize LLM prompts, tools, and agents in Opik using standardized optimizer workflows (prompt optimization, tool optimization, and parameter tuning), dataset/metric wiring, and result interpretation.

vincentkoc/dotskills · 41 tokens

prism

Consultant for NotebookLM steering prompt design. Optimizes Audio/Video/Slide/Infographic output quality through source preparation, prompt engineering, and Custom Goals persona design.

seaworld008/Commonly-used-high-value-skills · 37 tokens