token-kill

v0.0.1

Reduce OpenClaw token consumption by 95%+ using three optimization techniques (slash commands, script-first principle, and model tiering)

0· 142·0 current·0 all-time
byTimmy@niuben

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for niuben/token-kill.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "token-kill" (niuben/token-kill) from ClawHub.
Skill page: https://clawhub.ai/niuben/token-kill
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install token-kill

ClawHub CLI

Package manager switcher

npx clawhub@latest install token-kill
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The name and description promise token-cost reductions and the SKILL.md contains only recommendations (slash commands, script-first, model tiering) that directly align with that goal. There are no unrelated required binaries, env vars, or installs.
Instruction Scope
All runtime instructions are procedural recommendations (use /new, /compress, prefer scripts, route workloads to cheaper models). The file references (e.g., memory.md) are conceptual and the skill does not instruct the agent to read arbitrary files, exfiltrate data, or call unexpected external endpoints.
Install Mechanism
No install spec or code files are included; this is an instruction-only skill, which minimizes on-disk/remote-code risk.
Credentials
The skill requests no environment variables or credentials. Its recommendations to use external scripts imply that scripts will hold any needed secrets, which is proportionate to the guidance provided.
Persistence & Privilege
The skill does not request always:true or other elevated persistence. It is user-invocable and uses the platform's normal invocation model; no extra privileges are requested.
Assessment
This skill is guidance-only and appears coherent and low-risk. Before adopting: verify that the platform slash commands (/compress, /new, /stop, /restart) actually behave as described and won't delete or irreversibly prune needed data; when you implement the recommended scripts, store any service credentials securely (not in model prompts); test model-tier routing in a sandbox to ensure quality/latency trade-offs are acceptable; and run a billing/audit check after changes to confirm expected savings. If you need stronger guarantees, ask the skill author for concrete examples or scripts that you can review.

Like a lobster shell, security has layers — review code before you run it.

latestvk977ts2zx1988m1k7b04gdzeqn83645c
142downloads
0stars
1versions
Updated 1mo ago
v0.0.1
MIT-0

Token Kill - OpenClaw Token Optimizer

Need help optimizing your OpenClaw token usage costs? This Skill will guide you through three powerful optimization techniques to dramatically reduce token consumption.

Based on real-world case studies, applying these optimization techniques can reduce token consumption from $200+/day to $10/day, achieving a 95%+ cost reduction.

Three Core Token Optimization Techniques

1️⃣ Slash Commands Optimization

  • /new - Start a fresh conversation and clear old context (saves 50,000+ tokens)
  • /compress - Compress memory by keeping important info and forgetting details (saves 30,000+ tokens)
  • /stop - Immediately stop current task to prevent further token consumption
  • /restart - Restart the system to clear lag and resolve issues

2️⃣ Script-First Principle

Core Philosophy: AI is your brain, not your hands

Automate with scripts instead of using the model for mechanical tasks:

  • 📧 Email Checking - Scripts monitor emails; AI only notified of new messages ($100+/month → <$1/month)
  • 🌤️ Weather Queries - Direct API calls, zero token consumption
  • 📊 Data Fetching - Scripts retrieve data; AI only handles formatting
  • Scheduled Tasks - Scripts execute; prevent AI from polling
  • 🔄 Data Processing - Script handles transformations

3️⃣ Model Tiering Strategy

Use premium models for complex tasks, budget models for simple ones

ComplexityRecommended ModelCostUse CasesSavings
🔴 HighGPT-4 / Claude$0.03/1k tokensCode generation, creative writing, complex reasoningBaseline
🟡 MediumGPT-3.5-Turbo / Ernie$0.0005/1k tokensGeneral tasks, text editing98%
🟢 LowQwen, Tongyi (Budget Models)$0.00001/1k tokensData processing, report generation, formatting99.97%

Real-World Cost Reduction Cases

Case 1: Email Monitoring System

Problem: Model checks emails every 5 minutes

ApproachMonthly Cost
❌ Model Polling$100+/month
✅ Script + AI Notification<$1/month
Savings99%

Case 2: Daily Report Generation

Scenario: Generate reports every 30 minutes (2000 tokens/call)

ModelDaily CostMonthly CostSavings
GPT-4$2.88$86Baseline
GPT-3.5$0.048$1.4498%
Qwen$0.001$0.0399.97%

Examples

Example 1: Compressing Large Memory

Scenario: After many conversations, memory.md has grown to hundreds of thousands of characters

Solution:

  1. Execute /compress command
  2. System removes trivial details while preserving core information
  3. Memory size reduced by 30-50%

Result: Reduced context loading on each turn, saves 30,000+ tokens

Example 2: Replacing AI with Scripts

Scenario: Need to check for new orders every hour

Wrong Approach:

Have model check orders API every hour
→ Model must understand and judge each time
→ 24 checks per day = huge costs

Correct Approach:

Script checks order API every hour
Notify model only on new orders
Model handles decision-making only

Savings: Script uses only CPU, saves 90%+ tokens

Example 3: Model Tiering Workflow

Scenario: Handle various complexity levels

Strategy:

  • 💻 Code Writing → GPT-4 (worth the investment)
  • 📝 Content Editing → GPT-3.5 (good balance)
  • 📊 Report Generation → Budget Model (fully sufficient)

Result: 90% cost reduction, zero functionality loss

Guidelines

✅ Best Practices for Token Savings

1. Use Slash Commands Regularly

  • Execute /compress once daily - Prevent memory bloat
  • Use /new for long conversations - Start fresh after 1+ hours
  • Use /stop on wrong tasks - Stop immediately to prevent waste

2. Strictly Follow Script-First Principle

  • Scripts handle: Scheduled checks, data fetching, API calls, data processing
  • Never let AI handle: Polling, mechanical work, repetitive checks, resource-intensive operations
  • 💡 Core rule: AI = decision-making and judgment; Scripts = execution and heavy lifting

3. Enforce Model Tiering

Task TypeModel ChoiceReason
Code generation, deep analysisGPT-4Complex tasks worth the cost
General tasks, text editingGPT-3.5Best value proposition
Data processing, reportsBudget ModelsFully capable, lowest cost

4. Regular Token Usage Audit

  • Review billing distribution
  • Identify high-cost tasks for optimization
  • Adjust model configuration and scripts

❌ Common Token Wastage Patterns

Bad PracticeConsequenceSolution
Unlimited conversation historyGrowing memory = more tokensRegular /compress or /new
AI polling for updatesToken burn on each checkUse scripts instead
Using GPT-4 for simple tasksOverkill, high costUse appropriate model tier
Never compressing memoryLinear token cost growthEstablish compression habit
Continuing failed tasksWasted tokensUse /stop immediately

Token Cost Formula

Total Cost = Context Consumption + Task Consumption

Optimization Formula:
New Cost = (Original Context × 30%) + (Task Cost × 20%)
         = Original Cost × (0.3 + 0.2)
         = Original Cost × 0.5 or lower

Combining all three techniques achieves 95%+ cost reduction.

Key Principle

💡 Remember: High costs don't come from AI itself, but from making it do tasks it shouldn't do and remember information it shouldn't store.

Assign the right tasks to the right tools, and AI becomes truly cost-effective.

Comments

Loading comments...