Token Smart Saver Assistant
Paste the following prompt into your AI chat to install this skill:
Please install @user_29dc410e/token-saver-qclaw according to the guide at https://skillhub.cn/install/skillhub.md.
About this skill
In local large model dialogues, token consumption is a critical pain point. Each request consumes tokens, and local environments often have limited resources, leading to high costs, slow response times, and constraints from the model's context window. This impacts user experience and practicality.
Problem Background
Specifically, user inputs—whether text, code snippets, or mixed content—often contain redundant information like extra spaces, repeated phrases, or filler words. These redundancies, while not affecting semantics, occupy valuable token quota, causing dialogues to easily exceed model limits or reduce inference efficiency.
How the Skill Works
This Token Smart Saver Assistant addresses these issues through core capabilities:
-
Intelligent Content Type Recognition: Automatically identifies input as pure text, code, or mixed content, applying differential compression strategies with high accuracy to avoid semantic loss or code corruption.
-
Three Switchable Compression Levels:
Light Mode: Cleans only formatting issues, preserving original tone.Default Mode(Recommended): Removes redundant phrases, simplifies long sentences, balancing effect.-
Strict Mode: Deeply refines sentences, deleting connectors and redundant modifiers for higher compression. -
Text Deep Optimization:
- Intelligent synonym simplification for long sentences, e.g., converting "我想请问一下你能不能帮我写一个爬虫" to "写一个爬虫".
- Automatic deduplication of redundant phrases, filtering meaningless repetitions.
-
Normalization of spaces and formats to reduce token waste from formatting.
-
Safe Code Compression: Only compresses formatting (e.g., blank lines, indentation), with graded comment cleanup, but does not modify variable names, logic structures, or syntax keywords, ensuring code remains runnable.
-
System Command Protection Mechanism: Automatically identifies and skips key commands starting with
系统:,指令:, etc., preventing functional anomalies. -
Real-time Token Saving Statistics: Displays original tokens, compressed tokens, and saved count per dialogue round for transparency.
-
Natural Language Command Control: Users can switch modes with colloquial commands like "严格模式" or "打开省Token提示" without parameter configuration.
Applicable Boundaries and Notes
This skill is suitable for QClaw / OpenClaw local agents in daily dialogues, code queries, long text consultations, etc., especially for long-context dialogues that might exceed model windows. It emphasizes security, no external network dependency, and is ideal for enterprise or personal private deployments.
Notes:
- The skill does not alter code logic or model understanding, only optimizes token consumption.
- Compression strategies are rule-based, which might over-simplify in extreme cases, but default mode balances semantic integrity.
- It runs locally via pure Python execution with no third-party library dependencies, ensuring controllability.
Use Cases
- When developers use QClaw locally for code debugging, inputting long Python code snippets and detailed question descriptions, the skill automatically compresses code formatting and redundant text, saving tokens to maintain dialogue continuity without affecting logic.
- Enterprise IT administrators monitoring dialogue logs in privately deployed large models need to batch-process long-context records; the skill compresses filler words and repeated content, reducing token usage to optimize resource allocation.
- Technical documentation writers interacting with local AI agents to generate API documentation input mixed text descriptions and code examples; the skill identifies content types and differentially compresses spaces and comments to improve processing efficiency.
- Researchers analyzing experimental data with local large models in academic discussions submit mixed inputs containing long formulas and text; the skill deeply refines sentences, saving tokens to support more rounds of Q&A.
Best For
- Developers of local large model applications, frequently debugging complex code or testing new features, need to save tokens to reduce inference costs and improve interaction speed.
- Enterprise IT administrators responsible for maintaining privately deployed large model systems, need tools to compress dialogue tokens to extend service availability and optimize resource usage.
- Technical documentation writers, when interacting with large models to generate lengthy documents, need to control token consumption to avoid dialogue window overflow causing task interruptions.
- Educators at institutions using local AI agents to assist in grading code assignments or answering student questions, need to save tokens to support multiple batch interactions.
Related Skills
Run a grilling session to interact with or test AI agents.
A systematic prompt optimization skill that refines prompts using a four-step distillation framework (diagnose, structure, think, compress) and methodologies from four prompting masters.
Quickly converts a user's input, list, or screenshot into a multi-page workbench, supporting template selection, custom builds, and responsive layouts.
HeartFlow is a pure rule-based discrimination layer for AGI that checks AI outputs for correctness and safety before they reach humans.