Save Token — AI skill for Claude Code
save-token is a small Go CLI that runs a shell command, compresses its stdout/stderr with a rule-based engine, and prints condensed output while preserving the original exit code.
How to install Save Token
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open Nag112/save-token and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Save Token does
`save-token` is a small Go CLI that runs a shell command, compresses its stdout/stderr with a rule-based engine, and prints condensed output while preserving the original exit code. Point your AI agent (Copilot, Claude, etc.) at it and long command outputs cost far fewer tokens, without losing error messages, test failures, or other critical lines.
Alternatives in AI
- Ralph For Claude Code — by Frank Bria - An autonomous AI development framework that enables Claude Code to work iteratively on project 8k ★
- LongHorizon Harness — The long-horizon computer-use harness 1.3k ★
- Ralph Claude Code — Autonomous AI development loop for Claude Code with intelligent exit detection 1k ★
README
save-token
**Terminal output compression for AI coding agents.**
`save-token` is a small Go CLI that runs a shell command, compresses its stdout/stderr with a rule-based engine, and prints condensed output — while preserving the original exit code. Point your AI agent (Copilot, Claude, etc.) at it and long command outputs cost far fewer tokens, without losing error messages, test failures, or other critical lines.
save-token
How it works
- A safety gate inspects the command. Interactive, streaming, or unsafe
commands (
sudo,vim,ssh,tail -f, …) are refused and executed raw (fail-open) — output is never mangled when compression would be wrong. - A processor router picks the first matching formatter for the command:
git, test runners (pytest / jest /go test/ cargo test), linters (eslint / ruff), build output, package installs (pip / npm / cargo / go), with a generic fallback for everything else. - The engine applies compression gates (ratio checks, critical-line recovery) so that error lines, tracebacks, and failure summaries are never dropped.
&&/;command chains are split and compressed per segment.
The stdout you see is the compressed output; the process exit code is exactly the original command's exit code. A timeout exits `124` with partial compressed output.
Install
One-line install (recommended)
curl -fsSL https://raw.githubusercontent.com/Nag112/save-token/main/install.sh | bash
Downloads the latest release for your OS/arch into `~/.local/bin` (override with `SAVE_TOKEN_INSTALL_DIR`). Make sure `~/.local/bin` is on your `PATH`.
From a local checkout
./install.sh # builds with Go and installs to ~/.local/bin
./install.sh --from-release # force download from GitHub Releases
VS Code extension
The [`vscode-extension/`](vscode-extension/) folder is a VS Code extension that:
- Bundles the
save-tokenbinary and
Related Skills
Shuorenhua
说人话|Chinese-first AI writing refinement skill that reduces boilerplate and AI tone while preserving facts, ter
Pptx Shredder
Transform PowerPoint presentations into LLM-optimized markdown while preserving instructional design narrative
Agent Code
An open-source AI-native IDE that wraps the real Claude Code and Codex CLIs, preserving their native runtimes
English Refiner
A fast TUI tool for refining English text using LLM via OpenRouter. Fixes grammar while preserving your voice.
Modal Claude Agent SDK Python
This package wraps the Claude Agent SDK to execute AI agents in secure, scalable Modal containers. It provides
Dont Be So Lapalissian
I didn't make this to save tokens, but because I keep getting pissed off when AI talks to me like that. A writ
Related Agents
Node Developer
Node.js programs a person, shell or scheduler runs — a CLI and its bin, a script, a worker, a cron job, a daem
CLI Tooling Engineer
Use this agent to design or build a command-line tool — subcommand and flag layout, --help and error UX, exit
Impl Process Mgmt
Reviews implementation plans from a process management perspective. Use when evaluating subprocess spawning, s