token-saver: Instructions file for Claude Code

CLAUDE.md

token-saver CLAUDE.md is an instructions file for Claude Code from ppgranger/token-saver. It costs 145 tokens per session, scanned B, original, Apache-2.0.

A project instruction file for a plugin that shortens verbose command-line output before it reaches the coding agent.

In plain words
What is it for?
Use it when working on output processing for commands such as Git, Docker, npm, Terraform, or kubectl, or when debugging the plugin.
Why use it?
It helps reduce unnecessary text while preserving important command results, and defines cases where shortening must be skipped to avoid broken or unsafe behavior.

Instructions file for Claude Code

Written for Claude Code: PreToolUse hook event.

This is ppgranger/token-saver's own configuration. It tells Claude Code how to work on token-saver 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 token-saver configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ppgranger/token-saver. 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/ppgranger/token-saver/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/ppgranger/token-saver

Made for: Claude Code.

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 token-saver CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/ppgranger/token-saver/claude-md/github.svg)](https://agentmods.dev/instructions/ppgranger/token-saver/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/ppgranger/token-saver/claude-md"><img src="https://agentmods.dev/badge/instructions/ppgranger/token-saver/claude-md/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 token-saver CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/ppgranger/token-saver/claude-md"><img src="https://agentmods.dev/badge/instructions/ppgranger/token-saver/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 145 This file is loaded in full into every session.
When invoked 145 The same file — it is already loaded in full.
Security scan B 1 finding. 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.00145 $0.00145
Opus 5.5 $0.00058 $0.00058
Sonnet 5.5 $0.00029 $0.00029
Haiku 4.5 $0.00015 $0.00015

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

Security

Grade B, and why

token-saver CLAUDE.md scanned grade B with 1 finding 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- Never wrap sudo commands
CLAUDE.md · 16 lines

What it actually says

Token-Saver Plugin

Token-saver automatically compresses verbose CLI output to save tokens.

How it works

  • A PreToolUse hook intercepts Bash commands matching known patterns (git, docker, npm, terraform, kubectl, etc.)
  • The command output is piped through specialized compression processors
  • Compressed output is returned to Claude, saving tokens while preserving critical information

Important rules

  • Never wrap token-saver CLI commands themselves (avoid infinite loops)
  • Never wrap interactive commands (vim, nano, ssh, etc.)
  • Never wrap commands with redirections (>) or complex pipes
  • Never wrap sudo commands
  • Debug mode: set TOKEN_SAVER_DEBUG=true environment variable
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 · 16 lines · 145 tokens per session scan B e248e1acddd2

Subscribe to this mod's changes

token-saver CLAUDE.md is an instructions file published in the GitHub repository ppgranger/token-saver (161 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 145 tokens to every session, about $0.0006 per session on Opus 5.5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories