piratebao: Skill for Claude Code

.opencode/skills/piratebao-compress/SKILL.md

piratebao-compress is a skill for Claude Code, OpenCode from d4551/piratebao. It costs 78 tokens per session (1,119 once invoked), scanned A, a copy of caveman-compress, MIT.

A tool that shortens natural-language memory files, such as project instructions, task lists, and preferences, into a compact format for coding agents.

In plain words
What is it for?
Use it to compress files such as CLAUDE.md, todos, and preference notes with the /piratebao:compress command.
Why use it?
It reduces the amount of text an agent must read while preserving technical details, code, links, and structure. It also keeps a human-readable backup of the original file.

Skill for Claude CodeOpenCode

Written for Claude Code and OpenCode: shipped in a Claude Code plugin, but also installed under .opencode/. Also seen: mentions CLAUDE.md.

This is d4551/piratebao's own configuration. It tells Claude Code and OpenCode how to work on piratebao itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything piratebao configures →

Part of the piratebao plugin — 5 skills, 5 commands shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to d4551/piratebao. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/d4551/piratebao/main/.opencode/skills/piratebao-compress/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/d4551/piratebao

Made for: Claude Code, OpenCode.

Or install piratebao, the plugin that ships this one along with the rest of its 5 skills, 5 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 piratebao-compress

README.md
[![agentmods](https://agentmods.dev/badge/skills/d4551/piratebao/piratebao-compress/github.svg)](https://agentmods.dev/skills/d4551/piratebao/piratebao-compress)
Your own site
<a href="https://agentmods.dev/skills/d4551/piratebao/piratebao-compress"><img src="https://agentmods.dev/badge/skills/d4551/piratebao/piratebao-compress/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for piratebao-compress

Your own site · 80×15
<a href="https://agentmods.dev/skills/d4551/piratebao/piratebao-compress"><img src="https://agentmods.dev/badge/skills/d4551/piratebao/piratebao-compress.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,119 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 92% copy Near-identical to another mod 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.00078 $0.01119
Opus 5 $0.00039 $0.00560
Sonnet 5 $0.00016 $0.00224
Haiku 4.5 $0.00008 $0.00112

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

Security

Grade A, and why

piratebao-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 11d 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.

Origin

This is a copy

92% identical to caveman-compress — 28 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.opencode/skills/piratebao-compress/SKILL.md · 116 lines

How it starts

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

PirateBao Compress

Purpose

Compress natural language files (CLAUDE.md, todos, preferences) into PirateBao terse pirate-dumpling prose to reduce input tokens. Compressed version overwrites original. Human-readable backup saved as <filename>.original.md.

Trigger

/piratebao:compress <filepath> or when user asks to compress a memory file.

Process

  1. The TypeScript compressor lives in src/dumpling/ and runs from compiled dist/dumpling/piratebaoCompress.js.

  2. Run:

node dist/dumpling/piratebaoCompress.js <absolute_filepath>

  1. The CLI will:
  • detect file type (no tokens)
  • call Anthropic SDK to compress
  • validate output (no tokens)
  • if errors: cherry-pick fix with Claude (targeted fixes only, no recompression)
  • retry up to 2 times
  • if still failing after 2 retries: report error to user, leave original file untouched
  1. Return result to user

Compression Rules

Remove

  • Articles: a, an, the
  • Filler: just, really, basically, actually, simply, essentially, generally
  • Pleasantries: "sure", "certainly", "of course", "happy to", "I'd recommend"
  • Hedging: "it might be worth", "you could consider", "it would be good to"
  • Redundant phrasing: "in order to" → "to", "make sure to" → "ensure", "the reason is because" → "because"
  • Connective fluff: "however", "furthermore", "additionally", "in addition"

Preserve EXACTLY (never modify)

  • Code blocks (fenced ``` and indented)
  • Inline code (backtick content)
  • URLs and links (full URLs, markdown links)
  • File paths (/src/components/..., ./config.yaml)
  • Commands (bun install, git commit, docker build)
  • Technical terms (library names, API names, protocols, algorithms)
  • Proper nouns (project names, people, companies)
  • Dates, version numbers, numeric values
  • Environment variables ($HOME, NODE_ENV)

Preserve Structure

  • All markdown headings (keep exact heading text, compress body below)
  • Bullet point hierarchy (keep nesting level)
  • Numbered lists (keep numbering)
  • Tables (compress cell text, keep structure)
  • Frontmatter/YAML headers in markdown files

Read the full file on GitHub · 116 lines

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. 11d ago First seen · 116 lines · 78 tokens per session scan A 3e47b982b495

Subscribe to this mod's changes

piratebao-compress is a skill published in the GitHub repository d4551/piratebao (4 stars, last pushed 1mo ago), licensed MIT. It adds 78 tokens to every session and 1,119 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. It is 92% identical to caveman-compress, differing in 28 lines, and is treated as a copy.