semantic-compression

A skill for rewriting long technical instructions into a shorter, denser format while preserving their meaning and requirements. It is intended for prompts, tool descriptions, skills, and agent instructions.

In plain words
What is it for?
Use it to assess whether a prompt needs compression, measure the likely reduction, and re-encode load-bearing instructions without simply deleting words.
Why use it?
It reduces context usage when instructions are verbose, but stops when shortening would risk ambiguity or lost rules.

Skill for Claude CodeCodex

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 skills/can1357/oh-my-pi/semantic-compression
Any agent
npx skills add can1357/oh-my-pi --skill semantic-compression
Clone the repo
git clone --depth 1 https://github.com/can1357/oh-my-pi

Made for: Claude Code, Codex.

Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,402 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.00077 $0.03402
Opus 5 $0.00039 $0.01701
Sonnet 5 $0.00015 $0.00680
Haiku 4.5 $0.00008 $0.00340

Measured yesterday against content hash 11e5ee26fccf, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

semantic-compression 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 yesterday.

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.

.omp/skills/semantic-compression/SKILL.md · 143 lines

How it starts

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

Semantic Compression

Compression is re-encoding, not word deletion. Filtering function words out of an English sentence leaves a damaged English sentence (System design: efficient process incoming data, multiple sources). Instead re-frame each claim in a register whose grammar is punctuation and layout — then the function words have no work left and drop out on their own.

Target texts are load-bearing: tool descriptions, system prompts, skills. A model executes them cold, with no author present to disambiguate. Compression that forces a guess is a bug, not a saving.

Procedure

  1. Density gate — check before touching anything. Two signals, in order: (a) are articles and copulas already near-absent? (b) compress one representative section and measure the token delta. Already in this register (house-style prompt, tool doc, spec) or delta under ~10%? STOP. Report that it is already dense and keep the original. Bullet length alone is a weak signal — API literals and enumerations inflate it. Measured on a real house-style tool prompt: 853 → 778 tokens (8.8%), while that pass silently dropped a NEVER assume … rule, a throw condition, and a full-res detail. On already-dense text the remaining words are the payload, and the expected saving is smaller than the expected loss.
  2. Split the source into atomic claims: one definition, obligation, default, or fact each.
  3. Inventory the payload first, before deleting anything. List every load-bearing token: identifiers, error/exception names, throw conditions, defaults with their units, bounds, and every MUST/NEVER/PREFER line. Anything you then drop is a loss you declare deliberately rather than discover later.
  4. Cut what the model already knows. "JSON is a text format", "tests catch regressions" → delete. Keep only what is specific to this tool, repo, or domain.
  5. Cut restatements. Merge every duplicate of one rule into a single canonical line, placed where it is needed. Two statements of one rule with different scope are not duplicates.
  6. Frame each claim — definition · obligation · default · condition→consequence · enumeration · verdict. The frame picks the construction.
  7. Hoist repeated qualifiers into one scope line: three mentions of "relative to the repo root" → All paths repo-relative. once, up top.
  8. Re-encode, then run Verification.

Read the full file on GitHub · 143 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. yesterday First seen · 143 lines · 77 tokens per session scan A 11e5ee26fccf

Subscribe to this mod's changes

semantic-compression is a skill published in the GitHub repository can1357/oh-my-pi (28,439 stars, last pushed yesterday), licensed MIT. It adds 77 tokens to every session and 3,402 once invoked, about $0.0004 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-30.

Related

Other skills, from other repositories

agent-browser

Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

coleam00/Archon · 51 tokens

archon-cli

Drive Archon through its CLI: run AI workflows on a repo, manage those runs (inspect, approve, reject, cancel, resume), set up Archon or change its config, author new workflows, and improve workflow prompts. Use when the user says "use archon", "run archon", "archon workflow", "fix issue #N with archon", "have archon…

coleam00/Archon · 165 tokens

opengeni

Use when editing, operating, extending, documenting, or debugging the OpenGeni source repository or deployment: architecture, sessions/events, worker orchestration, sandbox backends, files/storage, tools/MCP, scheduling, configuration, and deployment. For a customer product that consumes a standalone OpenGeni…

Cloudgeni-ai/opengeni · 81 tokens

refactor-module

Transform monolithic Terraform configurations into reusable, maintainable modules following HashiCorp's module design principles and community best practices.

Cloudgeni-ai/opengeni · 28 tokens

terraform-search-import

Discover existing cloud resources using Terraform Search queries and bulk import them into Terraform management. Use when bringing unmanaged infrastructure under Terraform control, auditing cloud resources, or migrating to IaC.

Cloudgeni-ai/opengeni · 39 tokens

checkov

Use Checkov to scan Terraform and infrastructure-as-code repositories for policy violations, explain findings, choose safe fixes, rerun scans, and prepare pull requests with remediations.

Cloudgeni-ai/opengeni · 38 tokens