context-compression

context-compression is a skill for Claude Code from MaxForAI/Tokenless. It costs 39 tokens per session (2,116 once invoked), scanned A, original, MIT.

A rule for reducing large files, command results, logs, and search output before they are given to an AI agent. It uses Tokenless to create compact summaries while keeping important evidence available for expansion.

In plain words
What is it for?
Use it when reading large files, reviewing big diffs, or running commands with lengthy output so the agent can inspect the relevant information efficiently.
Why use it?
It prevents noisy or oversized information from consuming the agent’s context and instructs the agent what to do when an output is too large.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Claude Code.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./plugins/claude-code/bin/tokenless run --agent --data-dir /tmp/tokenless-dev -- npm test.

Part of the tokenless plugin — 1 skill, 4 hooks shipped together

Good fit Use it when reading large files, reviewing big diffs, or running commands with lengthy output so the agent can inspect the relevant information efficiently.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/MaxForAI/Tokenless
agentmods
npx agentmods add skills/maxforai/tokenless/context-compression

Made for: Claude Code.

Or install tokenless, the plugin that ships this one along with the rest of its 1 skill, 4 hooks.

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 context-compression

README.md
[![agentmods](https://agentmods.dev/badge/skills/maxforai/tokenless/context-compression/github.svg)](https://agentmods.dev/skills/maxforai/tokenless/context-compression)
Your own site
<a href="https://agentmods.dev/skills/maxforai/tokenless/context-compression"><img src="https://agentmods.dev/badge/skills/maxforai/tokenless/context-compression/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 context-compression

Your own site · 80×15
<a href="https://agentmods.dev/skills/maxforai/tokenless/context-compression"><img src="https://agentmods.dev/badge/skills/maxforai/tokenless/context-compression.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,116 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.00039 $0.02116
Opus 5.5 $0.00016 $0.00846
Sonnet 5.5 $0.00008 $0.00423
Haiku 4.5 $0.00004 $0.00212

Measured 1mo ago against content hash 34ff43f0ec41, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

context-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 1mo 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.

plugins/claude-code/skills/context-compression/SKILL.md · 126 lines

How it starts

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

Tokenless Context Compression

When working in this project, do not feed noisy raw outputs or large files directly into context.

Tokenless is mandatory for large or noisy context:

  • If a file is large, first use tokenless read --agent --data-dir <dir> <file>.
  • If a Bash command is noisy, first use tokenless run --agent --data-dir <dir> -- <command>.
  • If a Tokenless hook blocks or caps a tool call, do not bypass it with another full-output command.
  • If you need exact evidence after a packet, expand the artifact before editing.
  • If Tokenless reports a pending large-file gate, the next action must be the exact NEXT REQUIRED COMMAND.

The hook automatically caps high-noise Bash commands and large low-risk Read outputs through Tokenless.

Keep tool inputs small:

  • Tokenless saves context by replacing large tool outputs with compact packets. Do not recreate the same token cost by sending huge generated tool inputs.
  • Prefer tokenless read, tokenless expand, and small bounded Edit/MultiEdit calls over large patch scripts.
  • Do not create large heredocs, cat > file <<EOF, giant node -e / python - commands, or temporary apply/fix/rewrite scripts unless the user explicitly asks.
  • If you feel tempted to write a big script to patch a large file, stop and use Tokenless to expand the exact lines, then edit only that small region.

For manual local development in this repository, use ./plugins/claude-code/bin/tokenless or the packaged tokenless alias:

./plugins/claude-code/bin/tokenless run --agent --data-dir /tmp/tokenless-dev -- npm test

High-noise commands include:

  • npm test, pnpm test, yarn test
  • pytest
  • npm/pnpm/yarn build, lint, typecheck, install
  • go test, cargo test, mvn test/verify/package, gradle build/test
  • git diff, git log
  • rg, grep -R
  • find, tree, ls -R
  • docker logs/build, kubectl logs/describe, Vercel/Netlify CLI logs

When you see a TOKENLESS-PACKET block:

  1. Treat it as a compressed evidence packet.
  2. Use the key failures, relevant files, line numbers, and raw artifact pointer.
  3. Do not ask for the full raw output unless needed.
  4. If needed, use the full raw artifact command shown in the Raw artifact: line.

When you see a TOKENLESS-READ-PACKET block:

  1. Treat it as a compact local summary of a large file.
  2. Read Action boundary before running any other command. It defines what tool commands are valid for this artifact.
  3. If it contains Action brief and Editable snippets, treat those snippets as the first-pass edit surface, not as a table of contents to explore.
  4. For broad visual/style tasks, do one minimal native Read to register editor state if you plan to edit, then make 6-10 bounded Edit calls from the snippets before doing more exploration.
  5. Use only the artifact lookup commands shown in Action boundary when a needed old_string is not present in the snippets.
  6. Do not expand every listed region by default.
  7. Do not use repeated grep, rg, sed, or small Read calls to re-map the same file after a packet has already identified the edit targets.
  8. Do not add unrelated files, scripts, or JS/HTML interactions for a CSS-only request unless the user explicitly asks.

Tool boundaries:

  • tokenless read creates a whole-file packet only.
  • tokenless read is not a range, selector, or line lookup tool.
  • Do not invent tokenless read --range, tokenless read --selector, tokenless read --lines, or similar flags.
  • tokenless expand is the artifact lookup tool for a specific selector/text or line range.
  • tokenless show / raw artifact access is not for normal editing.

Large CSS visual-edit protocol:

  1. After a TOKENLESS-READ-PACKET, do not perform a second full-file read.
  2. Identify the smallest useful edit set from Editable snippets: tokens/variables, background layer, shared cards, buttons, one optional hero/visual area, one optional timeline/footer area.
  3. After the registration Read, make 6-10 bounded Edit calls when the snippets are sufficient.
  4. If exact old_string is missing, use at most two tokenless expand lookups before the first edit.
  5. Do not wait for File must be read first; proactively do one minimal native Read only to register editor state, then immediately edit. If the error still appears, do not remap the file.
  6. After the first successful edit, continue editing only if the user request still clearly needs it; otherwise stop with a concise summary.
  7. Do not open the page or run visual validation unless the user explicitly asks for validation.
  8. Do not make “extra premium” changes outside the asked surface, such as mouse-tracking JS, custom scrollbars in HTML, or new runtime scripts, unless requested.
  9. Final answer should be 3-5 concise bullets only; do not write a long change diary.

Read the full file on GitHub · 126 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. 1mo ago First seen · 126 lines · 39 tokens per session scan A 34ff43f0ec41

Subscribe to this mod's changes

context-compression is a skill published in the GitHub repository MaxForAI/Tokenless (46 stars, last pushed 5mo ago), licensed MIT. It adds 39 tokens to every session and 2,116 once invoked, about $0.0002 per session on Opus 5.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