# Send Tokenoptimizer to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "token-optimizer",
    "name": "Tokenoptimizer",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/smartpeopleconnected/token-optimizer",
    "canonicalUrl": "https://clawhub.ai/smartpeopleconnected/token-optimizer",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/token-optimizer",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=token-optimizer",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "CHANGELOG.md",
      "README.md",
      "SKILL.md",
      "_meta.json",
      "cli.py",
      "requirements.txt"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "token-optimizer",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-01T12:59:14.535Z",
      "expiresAt": "2026-05-08T12:59:14.535Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=token-optimizer",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=token-optimizer",
        "contentDisposition": "attachment; filename=\"token-optimizer-1.0.18.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "token-optimizer"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/token-optimizer"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/token-optimizer",
    "downloadUrl": "https://openagent3.xyz/downloads/token-optimizer",
    "agentUrl": "https://openagent3.xyz/skills/token-optimizer/agent",
    "manifestUrl": "https://openagent3.xyz/skills/token-optimizer/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/token-optimizer/agent.md"
  }
}
```
## Documentation

### Token Optimizer for OpenClaw

Slash your AI costs from $1,500+/month to under $50/month.

### The Problem

OpenClaw defaults prioritize capability over cost. You're burning expensive Sonnet/Opus tokens on tasks Haiku handles perfectly, paying for API heartbeats that could run free locally, and loading 50KB of context when 8KB suffices.

### The Solution

Four core optimizations plus powerful tooling:

### Model Routing (92% savings)

Haiku by default, Sonnet/Opus only when needed

### Multi-Provider Heartbeats (100% savings)

Route heartbeats to Ollama, LM Studio, Groq, or disable entirely. Not locked to one provider.

### Session Management (80% savings)

Load 8KB instead of 50KB context

### Caching (90% savings)

Reuse prompts at 10% cost

### New in v1.0.8

Rollback - List and restore config backups instantly
Health Check - Quick system status in one command
Diff Preview - See exactly what changes before applying
--no-color - CI/pipeline friendly output

### Cost Comparison

PeriodBeforeAfterDaily$2-3$0.10Monthly$70-90$3-5Yearly$800+$40-60

### What's Included

One-command optimizer with diff preview
Multi-provider heartbeat (Ollama, LM Studio, Groq)
Config rollback and health check commands
Ready-to-use config templates
SOUL.md & USER.md templates
Optimization rules for agent prompts
Verification and savings reports

### What This Tool Modifies

All changes are written under ~/.openclaw/. A backup is created before any modification.

PathPurpose~/.openclaw/openclaw.jsonMain OpenClaw config (model routing, heartbeat, budgets)~/.openclaw/backups/Timestamped config backups (created automatically)~/.openclaw/workspace/Template files (SOUL.md, USER.md, IDENTITY.md)~/.openclaw/prompts/Agent prompt optimization rules~/.openclaw/token-optimizer-stats.jsonUsage stats for savings reports

Safe by default - All commands run in dry-run (preview) mode. Pass --apply to write changes.

### Quick Start

# Install
clawhub install token-optimizer

# Analyze current setup
python cli.py analyze

# Preview changes (dry-run by default)
python cli.py optimize

# Apply all optimizations
python cli.py optimize --apply

# Verify setup
python cli.py verify

# Quick health check
python cli.py health

# Configure heartbeat provider (preview)
python cli.py setup-heartbeat --provider ollama

# Configure heartbeat provider (apply)
python cli.py setup-heartbeat --provider ollama --apply

# List and restore backups
python cli.py rollback --list
python cli.py rollback --to <backup-file>

### Configuration Generated

{
  "agents": {
    "defaults": {
      "model": { "primary": "anthropic/claude-haiku-4-5" },
      "cache": { "enabled": true, "ttl": "5m" }
    }
  },
  "heartbeat": {
    "provider": "ollama",
    "model": "ollama/llama3.2:3b"
  },
  "budgets": {
    "daily": 5.00,
    "monthly": 200.00
  }
}

### Links

GitHub: https://github.com/smartpeopleconnected/openclaw-token-optimizer
Issues: https://github.com/smartpeopleconnected/openclaw-token-optimizer/issues

### Author

Smart People Connected

GitHub: @smartpeopleconnected
Email: smartpeopleconnected@gmail.com

### License

MIT License - Free to use, modify, and distribute.

5 minutes to setup. 97% cost reduction. Stop burning tokens. Start building.
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: smartpeopleconnected
- Version: 1.0.18
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-01T12:59:14.535Z
- Expires at: 2026-05-08T12:59:14.535Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/token-optimizer)
- [Send to Agent page](https://openagent3.xyz/skills/token-optimizer/agent)
- [JSON manifest](https://openagent3.xyz/skills/token-optimizer/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/token-optimizer/agent.md)
- [Download page](https://openagent3.xyz/downloads/token-optimizer)