A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
The worlds #1 token optimizer reduces token consumption using Claude code cli by up to 98.9%
ASK Token Optimizer is a freemium product from ASK AI — free for individuals and teams under USD $100k, commercially licensed above. Proceeds from enterprise licensing go toward raising technology literacy in local communities and paying independent developers through our bounty program. Every commercial seat helps fund someone else's first commit.
— ASK-Ai Team Canada
Stop paying for tokens Claude never needed to see.
Proprietary binary · licensed under Community / Commercial terms · free under USD $100k annual revenue
🤖 Living UX Install — your agent installs it, tailored to your machine
Don't follow a static checklist. Point your AI coding agent (Claude Code, Cursor, Cline, Continue) at README-LLM.md and it runs a living install: it audits your actual environment — OS, CPU architecture, shell, where your Claude config and
PATHlive — then executes a post-install flow shaped to your system, wires the hooks (asking before it changes anything), and verifies the result end-to-end. One adaptive flow that fits Linux, macOS, Windows, or a Raspberry Pi — without you reading a single step.→ Hand your agent
README-LLM.md. It takes it from there.
Every time Claude Code runs a command — git status, grep, ls, cargo build — the full output lands in the context window. A single grep across a large codebase can dump 250,000 tokens of noise that Claude processes, charges you for, and largely ignores.
That's not a Claude problem. That's a plumbing problem. And it's solvable before it reaches Claude.
It sits between your terminal and Claude Code as two lightweight hooks. Before Claude sees a command's output, the optimizer filters it — stripping noise, collapsing repetition, keeping only what Claude actually needs to reason about. The output is structurally identical; the token count is not.
Without optimizer:
git status → raw output → Claude sees 1,200 tokens
With optimizer:
git status → filtered → Claude sees 110 tokens
↑
92% fewer tokens.
Same information.
No API key. No cloud. No account. The optimizer runs locally, processes output on your machine, and never touches the network.
Measured on a real Claude Code session: 351 commands over 30 days. Source: ask gain.
Figures are averages across all runs of that command type in a 30-day session. See honest audit below for steady-state numbers.
| Command type | Tokens saved |
|---|---|
grep (large codebases) | 98.9% |
curl (external API responses) | 95.7% |
git push | 92.8% |
find | 92.2% |
curl (local service responses) | 77–87% |
ls | 64.7% |
| Session total — 30 days, 351 commands | 87.7% |
340,000 input tokens compressed to 41,800 delivered to Claude.
The 87.7% session figure is real. But one command — a single grep run — produced 250,000 tokens of output and accounts for 93% of all savings in that figure. Remove that one outlier and measure the remaining 335 commands in steady-state:
| Headline (raw) | Steady-state | |
|---|---|---|
| Commands | 351 | 335 |
| Compression | 87.7% | 56.2% |
| Tokens in | 340K | 70.5K |
| Tokens saved | 298.5K | 39.6K |
What this tells you: ASK Token Optimizer is highly effective on high-volume output (grep, curl, build logs, large diffs) — those are the commands burning most of your budget anyway. On short-output commands (git status, quick reads) it compresses less. Your own workload will land somewhere between these two figures. Run ask gain after a day of use to see your real number.
We show both because you deserve to know what you're actually buying.
A single codebase. Two licenses. The engine is identical in both tiers — nothing is locked or degraded in the free version.
| Community | Commercial | |
|---|---|---|
| Who | Individuals + companies under USD $100k annual revenue | Companies at or above USD $100k for business use |
| Cost | Free, forever | By company size — not per seat, token, or compute |
| Engine | Full, unlimited | Same engine |
| Support | Community | SLA · priority fixes · dedicated contact · private channel |
| Additional rights | — | Internal redistribution · version pinning · security docs (roadmap) |
Installing or running the software constitutes acceptance of the LICENSE. Governing law: Canada. Commercial licensing: licensing@ask-ai.ca
Download or clone the SDK, then from its directory:
./setup.sh
Installs the binary, creates the ask shortcut, stages hook templates, and verifies. If no pre-built binary matches your platform and Rust is installed, it builds from source automatically.
.\install.ps1
Copies the binary to %USERPROFILE%\.local\bin, adds it to PATH, stages hooks. Full guide: INSTALL-WINDOWS.md.
Paste this into your agent. It follows README-LLM.md — the
machine-readable install contract — and installs + wires up the optimizer for you:
Follow README-LLM.md in this repo to install and configure ASK Token Optimizer.
The optimizer only runs once the two hooks are wired into Claude Code. Edit ~/.claude/settings.json (Linux / macOS / Pi4) or %USERPROFILE%\.claude\settings.json (Windows):
Linux / macOS / Pi4:
{
"hooks": {
"PreToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "$HOME/.claude/hooks/ask-rewrite.sh" } ] } ],
"PostToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "$HOME/.claude/hooks/ask-filter.sh" } ] } ]
}
}
Windows:
{
"hooks": {
"PreToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "python %USERPROFILE%\\.claude\\hooks\\ask-rewrite.py" } ] } ],
"PostToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "python %USERPROFILE%\\.claude\\hooks\\ask-filter.py" } ] } ]
}
}
Restart Claude Code, then confirm it's working:
ask gain
.
├── builds/
│ ├── linux-x86_64/ ← pre-built binary, Linux x86_64
│ ├── linux-arm64/ ← pre-built binary, Linux arm64 / Pi4
│ ├── macos-x86_64/ ← pre-built binary, macOS Intel
│ ├── macos-arm64/ ← pre-built binary, macOS Apple Silicon (M1/M2/M3)
│ └── windows-x86_64/ ← pre-built binary, Windows x86_64 (.exe)
├── hooks/ ← Claude Code hook templates (fork freely)
├── setup.sh ← Linux / macOS / Pi4 installer
├── install.ps1 ← Windows installer
├── INSTALL-WINDOWS.md ← full Windows guide
├── ask-token-optimizer.service ← optional: run as a system service
├── .env.example ← optional configuration
├── LICENSE
└── README.md
ask --version Version info
ask gain Your cumulative savings since install
ask gain --graph Daily savings trend
ask <command> <args> Run any supported command through the optimizer
ask --hook Compression endpoint used by the hooks
ask rewrite <cmd> Preview how a command would be rewritten
ask serve --port N Optional HTTP service mode (POST /v1/compress/output)
Supported commands: git · ls · tree · grep · find · cargo · npm · pnpm · aws · psql · gh · read · diff · json · deps · env — and more. Run ask --help for the full list.
Copy .env.example → .env. Everything defaults to local-only operation.
| Key | Default | Purpose |
|---|---|---|
COMPRESS_THRESHOLD | 2000 chars | Minimum output size before compression engages |
INFERENCE_URL | 127.0.0.1:8091 | Optional: your own local LLM endpoint for deep summarization |
LISTEN_ADDR | 127.0.0.1:8095 | Bind address when running in service mode |
No key ever points at Anthropic or any third-party service. Local by default. Inference is opt-in and runs wherever you point it.
Five steps, under two minutes. Open a terminal in the SDK directory.
# Linux / macOS / Pi4
./setup.sh
# Windows (PowerShell)
.\install.ps1
The installer asks to wire the hooks for you. If you say yes, skip to Step 4.
ask --version
# should print: ask-token-optimizer 0.4.3
If ask: command not found, add to your shell profile:
export PATH="$HOME/.local/bin:$PATH"
Open (or create) ~/.claude/settings.json and add the hooks block:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{ "type": "command", "command": "$HOME/.claude/hooks/ask-rewrite.sh" }
]
}
],
"PostToolUse": [
{
"matcher": "Bash",
"hooks": [
{ "type": "command", "command": "$HOME/.claude/hooks/ask-filter.sh" }
]
}
]
}
}
Windows — replace the two command values with:
"python %USERPROFILE%\\.claude\\hooks\\ask-rewrite.py"
"python %USERPROFILE%\\.claude\\hooks\\ask-filter.py"
Close and reopen Claude Code (or reload the window). The hooks activate on restart.
Run a few commands inside a Claude Code session, then:
ask gain
You should see token savings logged. A fresh install with no commands yet will show 0 — that's normal.
| Symptom | Fix |
|---|---|
ask: command not found | ~/.local/bin not on PATH — run export PATH="$HOME/.local/bin:$PATH" or restart your shell |
| Hooks not firing | Restart Claude Code after editing settings.json |
ask gain shows 0 | Run a few commands first — git status, ls -la, then check again |
Windows: ask not recognized | Open a new PowerShell window after the PATH change |
| macOS: "cannot be opened because the developer cannot be verified" | Run once: xattr -d com.apple.quarantine ~/.local/bin/ask-token-optimizer |
Is it safe to install? Yes. The optimizer only intercepts Bash tool output inside Claude Code. It does not touch your files, credentials, or environment. The hooks degrade safely — if the binary is missing or crashes, output passes through to Claude untouched.
Does it change what Claude does? No. Claude receives the same factual content, in fewer tokens. Filtered output is structurally accurate — noise and repetition are removed, not meaning.
Will it break my workflow?
Unsupported commands pass through unchanged. If a command's output looks wrong after filtering, run ask rewrite <cmd> to preview the transformation, or add it to the exclusion list in .env.
What happens to my data?
Nothing leaves your machine. Compression is entirely local. The history.db savings ledger lives at ~/.local/share/ask/history.db — readable with any SQLite viewer.
| ASK Token Optimizer | RTK | |
|---|---|---|
grep | 98.9% | 49.5% |
curl (external APIs) | 95.7% | 95.5% |
git push | 92.8% | — |
cargo test | 91.8% | 91.8% |
find | 92.2% | 78.3% |
git status | 80.8% | 80.8% |
ls | 64.7% | 68.1% |
read | 11.1% | 1.0% |
| Overall | 87.7% | 49.1% |
| Compression detail | 98.9% peak · 87.7% session · 56.2% steady-state | 60–90% range claimed |
| Audit | ask gain · per-command · --by-version timeline | None |
| Version tracking | Every row stamped with binary version | None |
| License | Free under $100k · Commercial above | None |
| Install | ./setup.sh · hook auto-wire · PATH check | Manual |
| Platforms | Linux · macOS · Windows · Pi4 | Linux x86_64 only |
| Your existing DB | Fully compatible — drop-in replacement | — |
Community support for the free tier. Commercial customers: SLA-backed support, include ask --version in any issue report. licensing@ask-ai.ca
ASK Token Optimizer · by ASK AI · LICENSE · Free under $100k · Commercial above
1000+ skills curated from Anthropic, Vercel, Stripe, and other engineering teams
A Claude Code skill by Hao (駱君昊) that learns your Facebook voice and auto-posts to FB / IG / Threads / X with a 14-day c
Route Claude Code traffic to any of 17 provider backends including free or local models
Human + AI music production workflow for Suno - skills, templates, and tools