devilking7x

Tokenslim — AI skill for Claude Code

AI community

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

  • Open Multi Agent — TypeScript multi-agent orchestration engine — one runTeam() call from goal to result 5.8k ★
  • Codeseek — Rust-powered code intelligence CLI for AI coding agents 764 ★
  • Ataru — High-performance AI memory retrieval for local agent history — a Rust search core (SDK / API / JSON CLI) plus 351 ★

README

![TokenSlim](og-image.webp)

![Demo — TokenSlim walkthrough](demo.gif)

**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 ![MIT](https://img.shields.io/badge/license-MIT-emerald)

**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

  1. 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.
  2. 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.
  3. 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).
  4. 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.
  5. Semantic Cache — A localStorage Q&A store. Ask a question; Jaccard similarity on word sets (threshold ~0.45)