A technical framework for slashing OpenClaw per-turn prompt costs by 70% through intelligent file splitting, prompt caching, and context management.
The fastest way to install a skill directly from the registry.
npx clawhub@latest install token-optimization
Copy the skill folder to one of these locations
~/.openclaw/skills/ <project>/skills/ Priority: Workspace > Local > Bundled
Copy this prompt to OpenClaw to install it automatically.
Help me install token-optimization using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).
Get the raw skill files in a ZIP archive.
This skill provides a systematic approach to optimizing token consumption within the OpenClaw ecosystem. By implementing structural changes to workspace files and fine-tuning model configurations, users can significantly reduce API overhead while maintaining full functionality. It is specifically designed for developers running production-scale Openclaw Skills who need to manage high-volume context windows and Anthropic API billing.
The methodology focuses on three primary layers: architectural file splitting to keep the core system prompt lean, enabling advanced prompt caching for persistent context, and aggressive context pruning to prevent memory bloat over long sessions. This ensures your agents remain fast and cost-effective.
To implement these optimizations, modify your openclaw.json configuration and clean your workspace directory.
# Check current workspace file sizes
wc -c ~/.openclaw/workspace/*.md
# Remove unnecessary bootstrap files
mv ~/.openclaw/workspace/BOOTSTRAP.md ~/.openclaw/workspace/BOOTSTRAP.md.bak
# Restart the gateway to apply configuration changes
openclaw gateway restart
The optimization process targets specific file sizes and configuration parameters to ensure efficient execution of Openclaw Skills.
| Component | Target Constraint | Description |
|---|---|---|
| AGENTS.md | <= 5KB | Core logic, safety rules, and subagent references. |
| MEMORY.md | <= 3KB | High-frequency reference items only. |
| cacheRetention | long | Configures 1-hour cache windows for Anthropic models. |
| contextPruning | cache-ttl | Mode for automated memory management based on message age. |
Loading
A professional-grade AI agent designed to rewrite and optimize resumes for international job markets using the STAR framework and ATS-best practices.

A structured math education skill by Xueersi that provides step-by-step logic and guided thinking for K-9 word problems.

A specialized communication skill designed to help product architects deliver professional, bilingual technical support to global clients.

A specialized automation skill for retrieving project summaries, technical articles, and technology trends from the OSChina ecosystem.

A sophisticated AI agent skill that transforms industry seed words into standardized, high-fidelity research reports with full data traceability.

A low-friction reflection tool that transforms messy brain-dumps into concise, supportive summaries of your day or week.








































