token-saver: Instructions file for Codex

AGENTS.md

token-saver AGENTS.md is an instructions file for Codex, OpenCode from ppgranger/token-saver. It costs 1,093 tokens per session, scanned A, original, Apache-2.0.

A repository guide for Token-Saver, a Python command-line tool that compresses command-line output locally and consistently. It also covers coding style, documentation, compatibility, tests, and related adapters.

In plain words
What is it for?
Use it when editing the Python code, writing public interfaces, formatting files, checking compatibility, or validating changes with the project’s tests.
Why use it?
It gives coding agents rules to follow so changes preserve the tool’s local, deterministic compression behavior and project conventions.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions CLAUDE.md; mentions Claude Code; mentions AGENTS.md.

This is ppgranger/token-saver's own configuration. It tells Codex and OpenCode 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/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/ppgranger/token-saver

Made for: Codex, OpenCode.

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 AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/ppgranger/token-saver/agents-md"><img src="https://agentmods.dev/badge/instructions/ppgranger/token-saver/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,093 This file is loaded in full into every session.
When invoked 1,093 The same file — it is already loaded in full.
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.01093 $0.01093
Opus 5.5 $0.00437 $0.00437
Sonnet 5.5 $0.00219 $0.00219
Haiku 4.5 $0.00109 $0.00109

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

Security

Grade A, and why

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

AGENTS.md · 98 lines

How it starts

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

Working on Token-Saver

Token-Saver is a Python 3.10+ CLI-output compressor, with Claude Code and Antigravity adapters and a Jekyll documentation site. Compression runs locally and deterministically, without an LLM or network call in the compression path.

Read the relevant instructions

This file applies to the repository. A nested AGENTS.md adds guidance for its directory; read it before editing there. CLAUDE.md describes plugin behavior and shell exclusions. Keep those guarantees consistent with code and tests.

Python style

Use the Google Python Style Guide as the review standard; CONTRIBUTING.md documents project tooling and exceptions.

  • Format Python to 80 columns. Preserve literal fixture data when wrapping would change its meaning; justify any narrow exception rather than disabling a rule.
  • Import modules by absolute package names and qualify their members. Typing symbols from typing, typing_extensions, and collections.abc are exempt.
  • Write meaningful Google-style docstrings for public interfaces and nontrivial behavior. Describe relevant Args, Returns/Yields, Raises, and public Attributes; do not mechanically restate signatures or test names.
  • Keep comprehensions simple: one for clause and at most one filter. Use loops for nested traversal and preserve processing order.
  • Catch specific exceptions. A broad catch requires an explicit isolation boundary or re-raise; record suppressed failures without commands, captured output, secrets, exception text, or traceback locals.
  • Include the repository's Apache 2.0 header in Python files. Preserve third-party copyright and license notices, including .pylintrc. Explain unavoidable local suppressions beside the relevant code.

Design and compatibility

  • Keep parsing/compression, orchestration, persistence, CLI presentation, and platform integration separate. Prefer small interfaces and injected dependencies where a real boundary exists; avoid abstract wrappers that add no behavior or independent test seam.
  • Extend the processor contract for a new command family instead of adding command-specific branches to the engine or platform hooks.
  • Preserve public CLI behavior, processor extension points, return shapes, and installed-tree imports during refactors. New src subpackages need explicit packaging and installer coverage; current copying discovers top-level source modules and processor modules.
  • Preserve failure details and secret redaction ahead of compression ratios. A redacted result must never be replaced by its unredacted input merely because a size threshold was not met.
  • Follow the existing Python 3.10 syntax and standard-library runtime approach. Use explicit UTF-8 for text files and text subprocess output.

Read the full file on GitHub · 98 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 · 98 lines · 1,093 tokens per session scan A 916878c468a3

Subscribe to this mod's changes

token-saver AGENTS.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 1,093 tokens to every session, about $0.0044 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-09-20.

Related

Other instructions, from other repositories