token-saver CLAUDE.md

token-saver CLAUDE.md is an instructions file for Claude Code from flightlesstux/token-saver. It costs 1,430 tokens per session, scanned B, original, MIT.

Project instructions for Token Saver, a Claude Code MCP plugin that detects wasteful output such as large logs, repeated history, and noisy tool results. MCP is a standard way for AI agents to connect to tools and services.

In plain words
What is it for?
Use them when modifying Token Saver's output analysis, alerts, token estimates, noise suppression, statistics, version handling, or cross-platform support.
Why use it?
They explain the repository's source-of-truth and engineering rules while documenting how the plugin identifies token waste and keeps the agent's context smaller.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

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 instructions/flightlesstux/token-saver/claude-md
Clone the repo
git clone --depth 1 https://github.com/flightlesstux/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/flightlesstux/token-saver/claude-md.svg)](https://agentmods.dev/instructions/flightlesstux/token-saver/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/flightlesstux/token-saver/claude-md"><img src="https://agentmods.dev/badge/instructions/flightlesstux/token-saver/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,430 This file is loaded in full into every session.
When invoked 1,430 The same file — it is already loaded in full.
Security scan B 2 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.1 $0.01430 $0.01430
Opus 5 $0.00715 $0.00715
Sonnet 5 $0.00286 $0.00286
Haiku 4.5 $0.00143 $0.00143

Measured 5d ago against content hash 2c2a016dca1b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade B, and why

token-saver CLAUDE.md scanned grade B with 2 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 5d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

In `~/.claude/settings.json`:

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

| Shell commands | `sh -c ...` | avoid; use Node `fs`/`child_process` with `shell: true` only when necessary |
CLAUDE.md · 147 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Version Source of Truth

Always check the latest version from GitHub before referencing any version number.

gh release list --limit 1

Never trust package.json, marketplace.json, plugin.json, or any hardcoded version string in the repo — always fetch the current release from GitHub and use that as the authoritative version.

Project Overview

This is a Claude Code MCP plugin that monitors Claude API outputs and fires warnings/errors/alerts when token usage is wasteful. It analyzes outputs for noise patterns, estimates token counts, suppresses logs and repetitive history, and reports cumulative waste statistics.

Core value proposition: In agentic coding sessions, large log outputs, verbose tool results, and repetitive history entries are re-sent on every turn, burning tokens on content nobody reads. This plugin catches these early, fires alerts at configurable thresholds, and auto-suppresses noise to keep context lean.

Engineering Mindset

All code in this repo follows BEST_PRACTICES.md. Read it before writing any code. Key rules that affect every file:

  • stdout is the MCP wire — never console.log() in tool handlers, use stderr
  • Every tool handler must catch all errors and return { isError: true, ... } — never throw
  • Every tool must define outputSchema — no schema, no merge
  • The irony rule: a token-saver plugin that floods context has failed at its core mission — tool responses must be small and structured

Cross-Platform Requirements

This plugin runs on Linux, macOS, and Windows. Every code path and every test must pass on all three. CI runs a 9-job matrix (3 OS × 3 Node versions).

Rules — always follow these

Topic Wrong Correct
Path construction dir + '/' + file path.join(dir, file)
Home directory ~ or process.env.HOME os.homedir()
Temp directory '/tmp' os.tmpdir()
Config path hardcoded string path.join(os.homedir(), '.claude', 'settings.json')
Line endings \r\n \n (.gitattributes enforces LF on all platforms)
Process signals SIGTERM only SIGINT + SIGTERM (SIGTERM is not available on Windows)
File permissions fs.chmod(...) alone guard with if (process.platform !== 'win32')
Shell commands sh -c ... avoid; use Node fs/child_process with shell: true only when necessary

Read the full file on GitHub · 147 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. 5d ago First seen · 147 lines · 1,430 tokens per session scan B 2c2a016dca1b

Subscribe to this mod's changes

token-saver CLAUDE.md is an instructions file published in the GitHub repository flightlesstux/token-saver (5 stars, last pushed 2mo ago), licensed MIT. It adds 1,430 tokens to every session, about $0.0072 per session on Opus 5. A static security scan graded it B with 2 findings (reads agent configuration directories, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.