LaunchKit · 2026
Back to Skills

token-saver

Reduce OpenClaw AI costs with model-aware optimization.

9
4.5k downloads
by @rubenaquispe

Setup & Installation

openclaw skills install @rubenaquispe/token-saver

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install token-saver

Version History

v3.0.0Feb 7, 2026 - Version note by skill developer:

v3: Model-aware optimization with dynamic presets, robust model detection, context window registry for 9+ models

What This Skill Does

Reduces AI API costs by compressing workspace files (SOUL.md, USER.md, MEMORY.md, etc.) that are sent with every API call. Detects the active model and adapts compaction thresholds to its actual context window size. Supports 24+ models including Claude, GPT-4, Gemini, and DeepSeek.

Dynamic presets scale compaction thresholds to each model's actual context window, so the same preset works correctly whether you're on GPT-4o's 128K or Gemini's 1M context.

When to use it

  • Cutting API costs on long agent sessions with large workspace files
  • Auditing which workspace files consume the most tokens before a project
  • Setting automatic chat compaction thresholds matched to the active model
  • Compressing MEMORY.md and USER.md into dense key-value format
  • Reverting workspace files to their pre-compression state after testing

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: optimize my workspace for the current model

AGENT
  1. 1Detect active model and retrieve its context window from the local registry
  2. 2Scan all workspace .md files and calculate token counts
  3. 3Apply file-appropriate compression to USER.md and MEMORY.md
  4. 4Set compaction threshold to 60% of the detected context window
  5. 5Create .backup files for all modified documents
OUTPUT

Compressed workspace files with auto-backups, compaction threshold set dynamically to model context size