Skip to content
Agentmart
Submit a tool

prompt-compress

Numeric-aware prompt compression for long ENGLISH prose you're about to feed another LLM — meeting transcripts, paper intros/discussion, web-article bodies…

Skill by jsb4702-glitch

IndexedMIT★ 7
Write a review

Chalk Labs

Need help deploying prompt-compress?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/jsb4702-glitch-prompt-compress

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Numeric-aware prompt compression for long ENGLISH prose you're about to feed another LLM — meeting transcripts, paper intros/discussion, web-article bodies, logs. Uses LLMLingua-2 (local, CPU, no API) but FIRST triages numeric-sentence density: if the document is number-heavy (FEA results, datasheets, spec tables, PN lists), it REFUSES to compress, because protecting the numbers caps the ratio near 1.3x and blind compression silently corrupts figures ("13,700 MPa"->"13,000"). Number-bearing sentences are protected verbatim (≈100% numeric recall); only the prose between them is compressed. Use when you have a large low-numeric-density English text blob to shrink before sending to a model. Triggers: "이 컨텍스트 압축", "프롬프트 토큰 줄여줘", "긴 문서 압축해서 넣어줘", "llmlingua", "compress this context". NOT for: spec/datasheet/results tables (it'll refuse), Korean text (compressor is English/MeetingBank-trained — quality unverified), or static repeated context (prompt caching is the lossless, cheaper answer there).

Use cases: documents, backend, ml, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/prompt-compress

What's inside

Skill name
prompt-compress
Description
Numeric-aware prompt compression for long ENGLISH prose you're about to feed another LLM — meeting transcripts, paper intros/discussion, web-article bodies, logs. Uses LLMLingua-2 (local, CPU, no API) but FIRST triages numeric-sentence density: if the document is number-heavy (FEA results, datasheets, spec tables, PN lists), it REFUSES to compress, because protecting the numbers caps the ratio near 1.3x and blind compression silently corrupts figures ("13,700 MPa"->"13,000"). Number-bearing sentences are protected verbatim (≈100% numeric recall); only the prose between them is compressed. Use when you have a large low-numeric-density English text blob to shrink before sending to a model. Triggers: "이 컨텍스트 압축", "프롬프트 토큰 줄여줘", "긴 문서 압축해서 넣어줘", "llmlingua", "compress this context". NOT for: spec/datasheet/results tables (it'll refuse), Korean text (compressor is English/MeetingBank-trained — quality unverified), or static repeated context (prompt caching is the lossless, cheaper answer there).
License
MIT
Instructions
63 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (2)

  • SKILL.md
  • compress.py

SKILL.md (first lines)

# prompt-compress

Selective, numeric-safe LLM prompt compression with a density triage gate.

## When to reach for this
- You have a **long English prose blob** (transcript, article, paper section, log)
  headed into another LLM and want to cut input tokens.
- The text is **narrative-heavy, number-light**. That's the sweet spot: protecting
  numbers costs almost nothing and you still get 2.5–3x.

## When NOT to (the gate enforces this)
- **Number-dense docs** (FEA results, datasheets, MIL-STD tables, BOM/PN lists):
  the tool refuses. Protected numeric span becomes a non-compressible floor
  (Amdahl) — measured 58%-numeric FEA paper caps at 1.72x ceiling, real ~1.45x.
  Just send raw text.
- **Static / repeated context** (system prompts, CLAUDE.md, fixed docs): use
  **prompt caching** — lossless and cheaper than any compression.
- **Korean / non-English**: the mBERT compressor is MeetingBank(EN)-trained;
  Korean compression quality is unverified. Triage still works; compression risky.

## Why the gate exists (measured, not asserted)
Blind LLMLingua-2 on an ankle-FEA paper (394 numeric tokens):

| mode | ratio | numeric recall |
|------|-------|----------------|
| blind rate=0.33 | 3.3x | **29.9%** (silent loss) |
| protect-numbers rate=0.33 | 1.45x | **100%** |
| ceiling (protected verbatim) | 1.72x | 100% |

Blind compression mangled "13,700 MPa" -> "13,000 MPa" with no error. Protection
fixes recall but the ratio collapses *because* the doc is number-heavy — which is
exactly why triage refuses number-heavy docs instead of pretending to help.

## Usage

```bash
cd ~/.claude/skills/prompt-compress
[ -d venv ] || (python3 -m venv venv && ./venv/bin/pip install -q llmlingua)

# 1) Triage only — decide if compression is worth it (no model math on output)
./venv/bin/python compress.py --in doc.txt --triage-only

# 2) Compress (auto-refuses if protected share > 40%)
./venv/bin/python compress.py --in doc.txt --rate 0.33 --out doc.min.txt

# stdin / pipe
cat doc.txt | ./venv/bin/python compress.py --rate 0.5
```

Flags: `--rate` keep-rate for prose span (0.33≈3x on the prose part), 
`--skip-threshold` protected-share cutoff (default 0.40), `--force` compress anyway,
`--triage-only` report density and stop.

## Notes
- CPU-only, fully local, no API cost. First run downloads ~1.1GB mBERT once.
- Protection is **sentence-level (coarse)**: any sentence containing a digit is kept
  whole. This is deliberate — fine-grained (number-token-only) protection lifts the
  ratio but reintvites boundary-token corruption. Coarse = safe.
- Always read back the `[done] numeric recall` line; if <100%, a number leaked into
  the compressed prose span — inspect before trusting.
- Output is plain text; feed it as context to the target model.

From jsb4702-glitch/verification-harness, MIT.

More from jsb4702-glitch/verification-harness

Signals

Stars
7
Forks
3
Open issues
0
Last commit (this folder)
Jul 19, 2026 (3 months ago)
Last release
Jul 21, 2026 (3 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from jsb4702-glitch

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get prompt-compress running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying prompt-compress?

CallGet help
Cite this page

prompt-compress skill. Agent Mart. https://agentmart.dev/skills/jsb4702-glitch-prompt-compress (last updated 2026-10-24)