smartpeopleconnected

Tokenoptimizer

AI 智能体v1.0.18
作者:smartpeopleconnected更新于 2026-05-11共 19 个版本 · 最新版本发布于 2026-02-21token-optimizer@clawhub_smartpeopleconnected/token-optimizer
任务自动化工作流编排#Prompt

据 AlphaMoat 统计,截至 2026-10,Tokenoptimizer 累计下载 26,178 次、获 34 个星标,按累计下载量在本次参与排名的 10,914 个 AI 技能中排名第 1,079 位,在「AI 智能体」分类(1,632 个)中排名第 164 位。

列表默认按累计下载量排序,也可按星标排序;详情页排名按累计下载量计算。

累计下载
2.6万
星标
34
全站下载量排名
#1,079
全站前 10% · 「AI 智能体」前 11%
平台累计下载星标评论
ClawHub ↗1.3万289
SkillHub ↗2.6万34—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

做法包括按需切换轻量模型、控制上下文体量、加缓存与预算约束,并提供变更前的 diff 预览、配置备份回滚与一条健康检查命令。源文自带的降本比例属于其主张,未在本轮材料中验证。持久化的路由、提示词与预算变更可能影响记忆和正确性;应用前检查 diff,复杂、安全敏感或高风险任务应按需覆盖低价模型/缩短上下文的默认设置。

资料发布于 2026-10-29

可以用来做什么

  • 把默认模型改成轻量档、复杂任务再升级
  • 在改配置前先看差异并保留可回滚备份

什么时候用

  • agent 调用成本偏高时
  • 想收紧上下文长度与预算时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

帮我把默认模型调成轻量档,复杂任务再切回去
先给我看这次配置改动的差异,再决定要不要应用

月度数据趋势

累计下载2.6万
9,1931.8万2.7万2026-03 · 累计下载 1.0万2026-05 · 累计下载 1.3万2026-06 · 累计下载 1.4万2026-07 · 累计下载 1.4万2026-08 · 累计下载 1.5万2026-09 · 累计下载 1.7万2026-10 · 累计下载 2.6万26-0326-0926-10
星标34
2229352026-03 · 星标 232026-05 · 星标 322026-06 · 星标 332026-07 · 星标 332026-08 · 星标 342026-09 · 星标 342026-10 · 星标 3426-0326-0926-10

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。 该技能有同名的其他版本,调整前的数据归属当前下载量最大的这一个。

月份累计下载环比星标
2026-102.6万—34
2026-091.7万—34
2026-081.5万+2.3%34
2026-071.4万+3.7%33
2026-061.4万+4.6%33
2026-051.3万—32
2026-031.0万—23

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

4.0 KB · ClawHub v1.0.18
---
name: token-optimizer
description: Reduce OpenClaw AI costs by 97%. Haiku model routing, free Ollama heartbeats, prompt caching, and budget controls. Go from $1,500/month to $50/month in 5 minutes.
homepage: https://github.com/smartpeopleconnected/openclaw-token-optimizer
triggers:
  - too expensive
  - costs too much
  - burning tokens
  - high token usage
  - reduce costs
展开全部(共 159 行)
  - save money
  - optimize tokens
  - budget exceeded
  - token optimization
  - cut api costs
  - lower ai spend
  - cheaper model
  - cost savings
  - api bill
  - spending too much
  - waste tokens
  - token budget
  - reduce token usage
---

# 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

| Period | Before | After |
|--------|--------|-------|
| Daily | $2-3 | $0.10 |
| Monthly | $70-90 | $3-5 |
| Yearly | $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.

| Path | Purpose |
|------|---------|
| `~/.openclaw/openclaw.json` | Main 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.json` | Usage stats for savings reports |

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

## Quick Start

```bash
# 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

```json
{
  "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](https://github.com/smartpeopleconnected)
- Email: [email protected]

## License

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

---

*5 minutes to setup. 97% cost reduction. Stop burning tokens. Start building.*

「AI 智能体」分类下的热门技能

数据月份:2026-10 · 下载/星标数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。