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.
npx agentmods add instructions/flightlesstux/token-saver/claude-mdgit clone --depth 1 https://github.com/flightlesstux/token-saverWrote 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.
[](https://agentmods.dev/instructions/flightlesstux/token-saver/claude-md)<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>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.
| Model | Per session | Once 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 |
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 | 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, usestderr - 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 |
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.
- 5d ago First seen · 147 lines · 1,430 tokens per session scan B 2c2a016dca1b
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.
Other instructions, from other repositories
ai-dial-core CLAUDE.md
Claude Code instructions for epam/ai-dial-core, covering claude.md, build & run, set credentials via environment variables, build (skip tests) and run all tests.
ai AGENTS.md
AGENTS.md instructions for vercel/ai, covering agents.md, project overview, repository structure, key directories and core package dependencies.
blockrun-mcp AGENTS.md
AGENTS.md instructions for BlockRunAI/blockrun-mcp, covering blockrun mcp, commands, project structure, key dependencies and install in codex.
InvestSkill GEMINI.md
Gemini CLI instructions for yennanliu/InvestSkill, covering investskill — gemini cli setup & usage guide, installation & setup, quick start, navigate to the investskill directory and start gemini cli (loads gemini.md automatically).
technocore-chat AGENTS.md
AGENTS.md instructions for flop-labs/technocore-chat: CI runs exactly these — run them before pushing.
openrouter-mcp-multimodal AGENTS.md
AGENTS.md instructions for stabgan/openrouter-mcp-multimodal, covering agent instructions, before you ship, releasing (read this before publishing), short version and version files (must all match package.json).