Agent skill

Token-Saver Configuration

by ppgranger in ppgranger/token-saver

Checks and tunes token-saver output compression: reads stats, explains why a command was or was not compressed, and edits config files or environment variables.

Apache-2.0Auto-check passedAgent Workflows

Install Token-Saver Configuration

skills CLI
$ npx skills add ppgranger/token-saver --skill token-saver-config -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ppgranger/token-saver token-saver-config --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ppgranger/token-saver.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/token-saver-config .claude/skills/token-saver-config && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
token-saver-config
GitHub stars
153
Token cost
~1k tokens
SKILL.md length
410 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
Apache-2.0

At a glance

Checks and tunes token-saver output compression: reads stats, explains why a command was or was not compressed, and edits config files or environment variables.

  • Works in 4 steps: Check that python3 (3.10+) is available… → Run token-saver explain "" to see the… → Set TOKEN_SAVER_DEBUG=true, trigger a… → …
  • Finding out why a specific command's output was or was not compressed
  • SKILL.md covers Check Status, Check Why a Specific Command…, Configuration and Debug Mode, plus 2 more sections
  • Calls python3

What it does

This skill helps diagnose token-saver, a tool that compresses command output for coding assistants. `token-saver stats` shows lifetime and per-command savings, `token-saver explain` reports the routing decision for a given command, and `token-saver benchmark` with `--dry-run` measures compression without replacing real output. There is no `config` subcommand, so settings are changed by editing files or environment variables.

Settings are layered, with later sources winning: built-in defaults, `~/.token-saver/config.json`, a project `.token-saver.json` found by walking up from the working directory, then `TOKEN_SAVER_*` variables. Commonly adjusted keys include `enabled`, `min_input_length`, `min_compression_ratio`, `wrap_timeout` (300 seconds by default), `chars_per_token`, `disabled_processors` and `max_output_bytes`. Some options, such as `disabled_processors`, are accepted only from the global config or the environment, never from a project file. A debug mode section follows.

When your agent uses it

  • Finding out why a specific command's output was or was not compressed
  • Raising the minimum compression ratio or turning off a processor such as docker
  • Reviewing token savings statistics
  • Debugging token-saver hook problems

Example prompts

  • “Run token-saver stats and tell me which commands save the most.”
  • “Why wasn't my git status output compressed? Use token-saver explain.”
  • “Disable the docker processor and set the minimum compression ratio to 0.1.”

Requirements

  • The token-saver command line tool

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Check that python3 (3.10+) is available in your PATH.
  2. Run token-saver explain "" to see the routing decision and why it was or wasn't wrapped.
  3. Set TOKEN_SAVER_DEBUG=true, trigger a compressible command, then check ~/.token-saver/hook.log for errors.
  4. Verify the hook itself responds correctly

What it can do on your machine

Read from SKILL.md and the folder at commit 19d47b2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Token-Saver Configuration loads about 1k tokens when it runs. Until then it costs about 54 tokens; SKILL.md has 410 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~54
When it runs · the whole SKILL.md, loaded when a task matches
~1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ppgranger/token-saver at commit 19d47b2, republished under its Apache-2.0 licence (© ppgranger). 410 words, ~1,023 tokens.

Download SKILL.mdSave it as .claude/skills/token-saver-config/SKILL.md (or your agent's skills folder).
name
token-saver-config
description
Configure and diagnose token-saver compression settings. Use when the user asks about adjusting compression levels, checking processor status, debugging hook issues, or reviewing savings statistics.

Token-Saver Configuration & Diagnostics

Check Status

Run token-saver stats to see lifetime and per-command compression statistics. Add --json for machine-readable output.

Check Why a Specific Command Was (or Wasn't) Compressed

There is no token-saver config subcommand — use explain and benchmark instead:

bash
token-saver explain "git status"          # routing decision: compressible? which processor? why excluded?
token-saver benchmark "npm install" --dry-run   # measure compression without replacing real output

Configuration

Settings are read in this order (later wins): built-in defaults → ~/.token-saver/config.json → a project-level .token-saver.json found by walking up from cwd → TOKEN_SAVER_* environment variables. There is no CLI subcommand to write these files — edit ~/.token-saver/config.json directly, or set an environment variable.

The most commonly adjusted settings and their actual defaults:

  • enabled (bool, default true): master on/off switch.
  • min_input_length (int, default 1): minimum output length in characters before compression is attempted.
  • min_compression_ratio (float, default 0.0): a compression result below this fraction is discarded and the original output is returned instead.
  • wrap_timeout (int, default 300): max seconds a wrapped command may run before being killed.
  • chars_per_token (int, default 4): used only to estimate token counts for display (stats, benchmark) — not part of compression itself.
  • disabled_processors (list, default []): processor names (e.g. "docker", "kubectl") to turn off entirely.
  • max_output_bytes (int, default 10_000_000): hard cap on output length before compression even runs.

Example ~/.token-saver/config.json:

json
{
  "min_compression_ratio": 0.1,
  "disabled_processors": ["docker"]
}

Equivalent environment variables: TOKEN_SAVER_MIN_COMPRESSION_RATIO=0.1, TOKEN_SAVER_DISABLED_PROCESSORS=docker.

Security note: user_processors_dir, disabled_processors, and redaction_allowlist can only be set via the global ~/.token-saver/config.json or an environment variable — never via a project-level .token-saver.json (that file is auto-discovered from any directory you cd into, so it is not trusted with these).

See src/config.py's _DEFAULTS dict for the full, authoritative list of settings — this file lists only the ones users actually tune.

Show full SKILL.md (162 more words)Show less

Debug Mode

Set TOKEN_SAVER_DEBUG=true to enable debug logging to ~/.token-saver/hook.log (or %APPDATA%\token-saver\hook.log on Windows).

Supported Processors

36 specialized processors, auto-discovered from src/processors/: git, gh (GitHub CLI), docker, kubectl, helm, terraform, pulumi, cdktf, ansible, nix, mise, npm/pip/cargo/go/maven/gradle/bun, package listing, python install, test runners (pytest, jest, go test, cargo test, …), lint output (eslint, ruff, pylint, clippy, …), build output, cloud CLIs (aws, gcloud, az), database queries, file listings, file content, environment/system info, network tools (curl, wget), search (grep, find, ripgrep), structured logs, syslog, ssh, jq/yq, act, just — plus a generic fallback for everything else.

Troubleshooting

If compression isn't working:

  1. Check that python3 (3.10+) is available in your PATH.
  2. Run token-saver explain "<the command>" to see the routing decision and why it was or wasn't wrapped.
  3. Set TOKEN_SAVER_DEBUG=true, trigger a compressible command, then check ~/.token-saver/hook.log for errors.
  4. Verify the hook itself responds correctly:
    bash
    echo '{"tool_name":"Bash","tool_input":{"command":"git status"}}' | python3 "${CLAUDE_PLUGIN_ROOT}/scripts/hook_pretool.py"
    A working hook prints a JSON object with hookSpecificOutput.updatedInput.command rewritten to invoke wrap.py.

© ppgranger, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/token-saver-config of ppgranger/token-saver.

Open the folder on GitHubat commit 19d47b2

Compare with similar skills

Token-Saver Configuration next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Token-Saver Configuration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Token-Saver Configuration this skillppgranger/token-saver153—~1kAutomated safety check: PassApache-2.0
Context Mode Output Sandboxmksglu/context-mode26k—~4.1kAutomated safety check: PassCustom licence
Context Mode for Antigravity CLImksglu/context-mode26k—~850Automated safety check: PassCustom licence
Context Fundamentalsguanyang/open-agent-hub9772 repos~4.2kAutomated safety check: PassMIT
Plugin Skill Development Guideanthropics/claude-plugins-official38k9 repos~5.6kAutomated safety check: PassApache-2.0
Context DoctorjzOcb/context-doctor119—~642Automated safety check: PassMIT

Similar skills

  • Context Mode Output Sandbox

    mksglu/context-mode

    Routes large command, file, API and browser output through context-mode tools so only the needed result enters the agent's context, instead of dumping it via Bash.

    26k GitHub stars~4.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Routing rules for using context-mode MCP tools in Antigravity CLI: sandboxed code runs, file analysis, indexed search and web fetches that keep large output out of the conversation.

    26k GitHub stars~850 tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Context Fundamentals

    guanyang/open-agent-hub

    This skill should be used to explain or reason about the foundational concepts of context engineering: what context is, the anatomy of a context window, how attention mechanics work, the U-shaped…

    977 GitHub starsUsed in 2 repos~4.2k tokens
    Agent WorkflowsAuto-check passed
  • Plugin Skill Development Guide

    anthropics/claude-plugins-official

    Official

    Explains how to design and write skills for Claude Code plugins: SKILL.md frontmatter, bundled scripts, references and assets, and descriptions that trigger at the right time.

    38k GitHub starsUsed in 9 repos~5.6k tokens
    Agent WorkflowsAuto-check passed
  • Context Doctor

    jzOcb/context-doctor

    Visualize and diagnose OpenClaw context window usage. An agent skill from jzOcb/context-doctor.

    119 GitHub stars~642 tokensUpdated 6 mo ago
    Agent WorkflowsAuto-check passed
  • Analyze Trajectory

    yologdev/yoyo-evolve

    Diagnoses a recurring failure such as a stuck task, repeated CI error or frequent reverts by sending sub-agents through the logs and returning one root-cause diagnosis.

    1.9k GitHub stars~3.6k tokensUpdated today
    Agent WorkflowsAuto-check passed

Categories

Questions about Token-Saver Configuration

What does Token-Saver Configuration do?

Checks and tunes token-saver output compression: reads stats, explains why a command was or was not compressed, and edits config files or environment variables. This skill helps diagnose token-saver, a tool that compresses command output for coding assistants. `token-saver stats` shows lifetime and per-command savings, `token-saver explain` reports the routing decision for a given command, and `token-saver benchmark` with `--dry-run` measures compression without replacing real output.

When should I use Token-Saver Configuration?

Token-Saver Configuration fits situations like: finding out why a specific command's output was or was not compressed; raising the minimum compression ratio or turning off a processor such as docker; reviewing token savings statistics; debugging token-saver hook problems.

How do I install Token-Saver Configuration in Claude Code?

Run `npx skills add ppgranger/token-saver --skill token-saver-config -a claude-code`. Or copy the skill folder (skills/token-saver-config in ppgranger/token-saver) into .claude/skills/token-saver-config in your project. Claude Code loads it when a task matches its description.

How do I install Token-Saver Configuration in Codex?

Run `npx skills add ppgranger/token-saver --skill token-saver-config -a codex`. Or copy the skill folder (skills/token-saver-config in ppgranger/token-saver) into .agents/skills/token-saver-config in your project. Codex loads it when a task matches its description.

Can I use Token-Saver Configuration in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ppgranger/token-saver --skill token-saver-config -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/token-saver-config, .gemini/skills/token-saver-config, .github/skills/token-saver-config and .opencode/skills/token-saver-config in your project.

What does Token-Saver Configuration need to run?

Going by SKILL.md and its folder, Token-Saver Configuration needs the command-line tools its instructions call (python3). Our summary lists: The token-saver command line tool.

Does Token-Saver Configuration access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Token-Saver Configuration safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Token-Saver Configuration use?

Token-Saver Configuration is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Token-Saver Configuration use?

About 1k tokens (SKILL.md is roughly 4.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Token-Saver Configuration?

Skills that share tags, products or a category with Token-Saver Configuration: Context Mode Output Sandbox (mksglu/context-mode, 26k stars), Context Mode for Antigravity CLI (mksglu/context-mode, 26k stars), Context Fundamentals (guanyang/open-agent-hub, 977 stars) and Plugin Skill Development Guide (anthropics/claude-plugins-official, 38k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Token-Saver Configuration?

ppgranger (a GitHub user) maintains it in ppgranger/token-saver, which has 153 GitHub stars. The repository was last updated on September 19, 2026.

Source: ppgranger/token-saver on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.