Tokenslim — AI skill for Claude Code
TokenSlim — spend fewer tokens on every LLM API call: prompt compression, 350-skill router, model cascade, semantic cache.
How to install Tokenslim
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open devilking7x/tokenslim and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Tokenslim does
TokenSlim — spend fewer tokens on every LLM API call: prompt compression, 350-skill router, model cascade, semantic cache.
Alternatives in AI
- Codeseek — Rust-powered code intelligence CLI for AI coding agents 764 ★
- Squeez — Hook-based token compressor for 5 AI CLI hosts (Claude Code, Copilot CLI, OpenCode, Gemini CLI, Codex CLI) 188 ★
- Llmix — Production LLM call layer for AI agents and tools: keep OpenAI/Anthropic/AI SDK/LiteLLM, hot-swap models with 132 ★
README


**Demo** — 13-second walkthrough: compress a bloated prompt, route skills without flooding context, hit the semantic cache, and watch savings land on the dashboard.
TokenSlim 
**Trim AI costs without trimming quality.** TokenSlim is a 100% client-side workbench for cutting LLM token spend — compress prompts, route skills without flooding context, cascade models by task difficulty, budget reasoning tokens, cache semantically, and plan spend against a budget. Every saving is tracked on a dashboard. Nothing leaves your browser.
🔗 **Live demo:** https://devilking7x.github.io/tokenslim/
Features
- Prompt Optimizer — Paste a bloated prompt; a rule-based compressor strips filler phrases ("please", "could you kindly", "as an AI"…), dedupes repeated sentences, collapses whitespace, and rewrites as tight imperative bullets. Real BPE token counts before/after via
gpt-tokenizer, savings %, word-level diff, and one-click copy. Savings auto-log to the dashboard counter. - Skill Router — A searchable registry of 350 skills (35 × 10 categories). The key insight, shown with live math: loading all 350 skill bodies costs ~28k tokens; the router loads the tiny registry and fetches only the 2 bodies you need. 18 full skill bodies ship with the app; the rest load on demand.
- Model Cascade — Pick task complexity (trivial → hard) and get a recommended tier mix. Compare "naive (always flagship)" vs "cascade" costs for 1k / 10k / 100k calls. The cost-per-1M table is seeded with realistic 2026 prices and is user-editable (stored in your browser).
- Thinking Budget — Slider from 0–16k reasoning tokens per task; see the cost uplift on a 10k-task sample workload, with an honest explainer of reasoning-token waste.
- Semantic Cache — A localStorage Q&A store. Ask a question; Jaccard similarity on word sets (threshold ~0.45)
Related Skills
Distil
Measure what context compression actually costs an LLM agent: where a session's tokens go, and whether a rewri
Scrooge Mode
Same answer, fewer tokens — KO-first LLM output-compression skill for Claude Code & Codex. A Korean-native cav
Lm Resizer
Rust-native context compression for Claude Code, Codex & MCP agents: filters & compresses noisy tool output (t
Clean Mac Jev
macOS disk cleaner using a model cascade: Jev (TypeSafe) classifies hundreds of cache folders for cents, Claud
Burn O Meter
See what your AI coding agents really cost — tokens, spend, cache efficiency and rate limits. Works with Claud
Openproxy
Smart AI proxy router that connects Claude Code, Cursor, Codex, Copilot, and 50+ coding tools to 40+ AI provid
Related Agents
LLM Sec Review
LLM/agent security review specialist — prompt injection, the Agents Rule of Two, tool-call authorization, mode
Rot Soleil
The Soleil_Blank lens — Phantom Steganography, the Invisible Architect. Encodes intent at maximum semantic den
Budget
AI cost engineering — LLM spend tracking, model cost optimization, budget alerts, token efficiency audits