# Send Token Optimizer 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. 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. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "mkhaytman-token-optimizer",
    "name": "Token Optimizer",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/mkhaytman87/mkhaytman-token-optimizer",
    "canonicalUrl": "https://clawhub.ai/mkhaytman87/mkhaytman-token-optimizer",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/mkhaytman-token-optimizer",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=mkhaytman-token-optimizer",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "agents/openai.yaml",
      "config/defaults.json",
      "examples/usage.md",
      "package.json",
      "references/operating-notes.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "mkhaytman-token-optimizer",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-10T03:16:23.399Z",
      "expiresAt": "2026-05-17T03:16:23.399Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=mkhaytman-token-optimizer",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=mkhaytman-token-optimizer",
        "contentDisposition": "attachment; filename=\"mkhaytman-token-optimizer-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "mkhaytman-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/mkhaytman-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/mkhaytman-token-optimizer",
    "downloadUrl": "https://openagent3.xyz/downloads/mkhaytman-token-optimizer",
    "agentUrl": "https://openagent3.xyz/skills/mkhaytman-token-optimizer/agent",
    "manifestUrl": "https://openagent3.xyz/skills/mkhaytman-token-optimizer/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/mkhaytman-token-optimizer/agent.md"
  }
}
```
## Documentation

### Overview

Use this skill to optimize OpenClaw token usage with a local CLI that performs analysis, compression snapshots, health checks, cleanup planning, and preflight token budgeting.

### Quick Start

$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --analyze --period 7d

### Core Commands

Enable local optimizer config:

$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --enable

Optimization analysis:

$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --analyze --period 7d

Force context compression snapshot:

$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --compress --threshold 0.7 --session agent:main:main

Session health check:

$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --health-check --active-minutes 120

Auto-cleanup planning and apply:

$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --cleanup
$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --cleanup --apply

### Preflight Optimization

Use preflight planning before expensive task batches:

$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize \\
  --preflight /path/to/actions.json \\
  --session-limit 180000

actions.json should be a JSON array of planned operations, for example:

[
  {"type": "web_search", "query": "..."},
  {"type": "web_fetch", "url": "..."},
  {"type": "summarize", "target": "youtube"}
]

### Output Artifacts

Compression snapshots: $OPENCLAW_WORKSPACE/token-usage/compressed/
Optional JSON output: --format json --output /path/file.json
Baseline config (from --enable): $OPENCLAW_WORKSPACE/token-usage/token-optimizer.config.json

### Defaults

Default behavior is configured in:

config/defaults.json

Override with:

$OPENCLAW_SKILLS_DIR/token-optimizer/scripts/token-optimize --config /path/custom.json --analyze

### Resources

scripts/token_optimize.py: main CLI
src/optimizer.py: core optimization engine
src/models.py: model selection logic
src/compression.py: context compression helpers
src/cleanup.py: session hygiene evaluation
references/operating-notes.md: implementation details and safe-operating guidance

### Validation

python3 $OPENCLAW_SKILLS_DIR/.system/skill-creator/scripts/quick_validate.py \\
  $OPENCLAW_SKILLS_DIR/token-optimizer
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: mkhaytman87
- Version: 1.0.0
## 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-10T03:16:23.399Z
- Expires at: 2026-05-17T03:16:23.399Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/mkhaytman-token-optimizer)
- [Send to Agent page](https://openagent3.xyz/skills/mkhaytman-token-optimizer/agent)
- [JSON manifest](https://openagent3.xyz/skills/mkhaytman-token-optimizer/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/mkhaytman-token-optimizer/agent.md)
- [Download page](https://openagent3.xyz/downloads/mkhaytman-token-optimizer)