pdf-compress

pdf-compress is a skill for Claude Code, Codex from ncepuee/PDFCompress. It costs 53 tokens per session (359 once invoked), scanned A, original, MIT.

A workflow for analyzing, compressing, and checking local PDF files while preserving their text, vector graphics, page geometry, and source file.

In plain words
What is it for?
Meeting file-size limits, downsampling images, optimizing PDFs, and verifying the output.
Why use it?
It reduces file size while checking that the resulting PDF remains structurally and textually usable, and avoids overwriting the original.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the pdfcompress plugin — 1 skill, 1 MCP server shipped together

Good fit Meeting file-size limits, downsampling images, optimizing PDFs, and verifying the output.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ncepuee/pdfcompress/pdf-compress
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 ncepuee/PDFCompress --skill pdf-compress
Clone the repo
git clone --depth 1 https://github.com/ncepuee/PDFCompress

Made for: Claude Code, Codex.

Or install pdfcompress, the plugin that ships this one along with the rest of its 1 skill, 1 MCP server.

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 pdf-compress

README.md
[![agentmods](https://agentmods.dev/badge/skills/ncepuee/pdfcompress/pdf-compress.svg)](https://agentmods.dev/skills/ncepuee/pdfcompress/pdf-compress)
Your own site
<a href="https://agentmods.dev/skills/ncepuee/pdfcompress/pdf-compress"><img src="https://agentmods.dev/badge/skills/ncepuee/pdfcompress/pdf-compress.svg" alt="Measured on agentmods" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 359 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.00053 $0.00359
Opus 5 $0.00026 $0.00179
Sonnet 5 $0.00011 $0.00072
Haiku 4.5 $0.00005 $0.00036

Measured 7d ago against content hash b17d1d24041f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

pdf-compress 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 7d 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.

skills/pdf-compress/SKILL.md · 36 lines

What it actually says

PDFCompress

Use the pdfcompress MCP tools when available; otherwise run the CLI.

Workflow

  1. Analyze the source before changing anything:

    pdfcompress analyze "input.pdf" --json
    
  2. Preserve the source and write to a different output path. For official, award, tender, or archival material, start with archive-safe; otherwise use high.

  3. If the user specifies a size limit, pass --target-size-mb. The tool reopens the original for every progressively stronger preset, avoiding cumulative JPEG loss.

    pdfcompress compress "input.pdf" "output.pdf" --preset archive-safe --target-size-mb 4 --json
    
  4. Report the output path, source/output byte sizes, reduction percentage, selected preset, verification status, and all warnings.

Safety boundaries

  • Never use the same path for input and output.
  • Do not overwrite an existing output unless the user explicitly authorizes it.
  • Rewriting invalidates digital signatures. Stop on signed PDFs unless the user explicitly accepts signature loss and the signed original remains preserved.
  • Keep text checking enabled unless extraction is unavailable or the user explicitly chooses structural-only verification.
  • Treat text_equal: false, changed page counts, or changed page boxes as failure.
  • A target-size miss is not permission to rasterize whole pages or remove fonts, bookmarks, attachments, annotations, or visible layers.
Files

What ships with it

1 file 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. 7d ago First seen · 36 lines · 53 tokens per session scan A b17d1d24041f

Subscribe to this mod's changes

pdf-compress is a skill published in the GitHub repository ncepuee/PDFCompress (1 stars, last pushed 11d ago), licensed MIT. It adds 53 tokens to every session and 359 once invoked, about $0.0003 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

paper-writing

Write and typeset formal documents — academic papers, reports, articles — using Markdown + Pandoc and LaTeX. Convert between formats (md↔pdf↔docx↔tex), manage citations with BibTeX/CSL. Keyless, local. Use when asked to "write a paper", "format this as LaTeX", "convert to PDF/Word", "add citations".

diillson/chatcli · 86 tokens

ocr

Extract text from images and scanned PDFs using local OCR (Tesseract). Keyless, offline. Use when asked to "read text from this image", "OCR this", "extract text from a screenshot/scan", or given an image with text.

diillson/chatcli · 53 tokens

pdf-tools

Manipulate PDFs locally — merge, split, extract pages, rotate, compress, extract text, convert images↔PDF. Uses keyless local CLIs (pdftk/qpdf/pdftotext/poppler/img2pdf/Ghostscript). Use when asked to "merge PDFs", "split this PDF", "extract text from PDF", "compress PDF", "PDF to images".

diillson/chatcli · 82 tokens

evyasys-generate-release-note

Use this skill to compile a short, beautiful, branded PDF release notes document from one or more completed stories. Accepts multiple story IDs as arguments or asks for them if none are provided. Reads each story's FinishQa artefacts, groups them by Epic, consolidates quality gates with emoji status icons, and…

Evyasys-Software-Solutions/EvyaGovernance · 108 tokens

pydicom

Use pydicom to read, inspect, write, transform, and safely preflight local DICOM datasets and pixel data. Applies to DICOM metadata, transfer syntaxes, compression plugins, frames, private elements, JSON, and bounded de-identification review.

K-Dense-AI/scientific-agent-skills · 56 tokens

foundry-hosted-agent-validation

Step-by-step process for validating a Python Foundry hosted agent sample (under python/samples/04-hosting/foundry-hosted-agents/) end to end — running it locally (native runtime and azd ai agent run) and after deploying it to an Azure AI Foundry project with azd. Use this when asked to validate a hosted agent sample.

microsoft/agent-framework · 82 tokens