token-manager

Classify task complexity and switch models to reduce token consumption.

Updated Mar 15, 2026
One-click install
npx skills add https://github.com/Jaykaijack/openclaw-backup --skill token-manager-jaykaijack
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: token-manager
Source: https://github.com/Jaykaijack/openclaw-backup/tree/main/skills/token-manager
Command: npx skills add https://github.com/Jaykaijack/openclaw-backup --skill token-manager-jaykaijack

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Token consumption and cost creep caused by inappropriate model selection and oversized conversation memory are hard to track and optimize; this Skill reduces expenses by automatically choosing models and prompting memory compression when context grows too large.

Core Features & Use Cases

  • Automatic Model Scheduling: Classifies task complexity and routes simple tasks to economical models while reserving premium models for complex coding or reasoning.
  • Context Monitoring & Compression Reminders: Continuously estimates memory size and token impact, warning users at thresholds and recommending compression to save tokens.
  • Task Complexity Analysis & Scripts: Provides local scripts to analyze workspace memory, estimate tokens, and evaluate task complexity for reproducible cost-saving decisions.
  • Use Case: Lower costs for an assistant that mixes frequent short Q&A and occasional code generation by silencing model switches and compressing large MEMORY.md files.

Quick Start

Ask Token Manager to analyze workspace memory and recommend whether to run /compress.

Frequently Asked Questions about token-manager

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce token consumption when mixing simple Q&A and complex code generation in an agent workflow?

Reduce token consumption by automatically classifying task complexity to route simple queries to economical models and reserving premium models for complex coding. This silent model switching minimizes costs without manual intervention across varying task complexities.

What is context compression and when do I need it for large conversation memory?

Context compression reduces oversized conversation memory by summarizing or truncating accumulated history. You need it when context size monitoring detects token thresholds are exceeded, triggering reminders to compress workspace memory files like MEMORY.md to save tokens.

How to automatically select appropriate models based on task complexity?

Automatically select appropriate models by running local scripts that evaluate task complexity and analyze workspace memory. The scripts classify whether a task is simple Q&A or complex reasoning, routing each to the corresponding economical or premium model silently.

Does token optimization work with local workspace memory files like MEMORY.md?

Yes, token optimization works with local workspace memory files by continuously estimating memory size and token impact. It analyzes MEMORY.md files directly, warning users at configured thresholds and recommending compression to prevent cost creep from oversized memory.

Can I monitor context size and get compression reminders in long-running agent workflows?

Yes, you can monitor context size in long-running agent workflows. The system continuously estimates token impact and issues compression reminders when memory accumulation exceeds thresholds, ensuring sustained cost-saving during extended chat and agent operations.

What's the best way to minimize token costs for assistants handling frequent short queries and occasional code generation?

The best way to minimize token costs is combining automatic model scheduling with context compression. Classifying task complexity routes short queries to cheaper models, while compression reminders manage long-running memory accumulation, effectively reducing expenses for mixed-comcurrency assistants.