ccjingeth

OpenClaw Token Optimizer

AI 智能体v1.0.0
作者:ccjingeth更新于 2026-05-17openclaw-token-save@clawhub_ccjingeth/openclaw-token-save
提示词优化上下文管理记忆增强#Cron#Json#Prompt

据 AlphaMoat 统计,截至 2026-10,OpenClaw Token Optimizer 累计下载 5,477 次、获 3 个星标,按累计下载量在本次参与排名的 10,914 个 AI 技能中排名第 5,280 位,在「AI 智能体」分类(1,632 个)中排名第 737 位。

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

累计下载
5,477
星标
3
全站下载量排名
#5,280
全站前 49% · 「AI 智能体」前 46%
平台累计下载星标评论
ClawHub ↗5,3183-
SkillHub ↗5,4773—

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

这个技能是做什么的

文档建议检查注入的工作区文件、对话历史、缓存、裁剪与记忆搜索等成本来源,再核实模型和提供商是否支持相关设置。输出应作为配置建议和分阶段计划;节省估计不是实测结果,应用前需验证版本兼容性。

资料发布于 2026-10-27

可以用来做什么

  • 梳理上下文注入和调用成本来源
  • 规划文件裁剪、缓存或记忆检索调整
  • 制定可验证的分阶段配置计划

什么时候用

  • 需要审计 OpenClaw 的 token 使用或成本时
  • 应用配置更改前能够核实提供商、模型和版本支持时

示例提示词

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

基于当前配置提出 token 优化方案,区分估算项和需要实测验证的效果。

月度数据趋势

累计下载5,477
2,2273,9735,7182026-03 · 累计下载 2,4682026-05 · 累计下载 4,5882026-06 · 累计下载 4,7582026-07 · 累计下载 4,9822026-08 · 累计下载 5,0962026-09 · 累计下载 5,2582026-10 · 累计下载 5,47726-0326-0926-10
星标3
2342026-03 · 星标 32026-05 · 星标 32026-06 · 星标 32026-07 · 星标 32026-08 · 星标 32026-09 · 星标 32026-10 · 星标 326-0326-0926-10

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-105,477—3
2026-095,258—3
2026-085,096+2.3%3
2026-074,982+4.7%3
2026-064,758+3.7%3
2026-054,588—3
2026-032,468—3

SKILL.md 原文

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

3.3 KB · ClawHub v1.0.0
---
name: openclaw-token-optimizer
description: Optimize OpenClaw token usage and cost by auditing context injection, trimming workspace files (AGENTS.md/SOUL.md/MEMORY.md and daily memory), enabling prompt caching, heartbeat, context pruning, compaction, memory search or qmd, subagents, model tiering, and cron frequency. Use when a user asks to reduce OpenClaw token spend, speed up sessions, shrink context, or configure openclaw.json and memory search settings.
---

# OpenClaw Token Optimizer

## Overview
Deliver a practical audit and configuration plan that cuts input tokens and unnecessary calls while keeping answer quality. Provide concrete config edits, workspace file trimming guidance, and a prioritized rollout plan.
展开全部(共 54 行)
## Workflow

### 1) Scope and locate configuration
- Identify the OpenClaw config file location (common paths include `~/.openclaw/openclaw.json`, `.openclaw/openclaw.json`, or project root config).
- List injected workspace files in scope (e.g., `AGENTS.md`, `SOUL.md`, `TOOLS.md`, `IDENTITY.md`, `USER.md`, `HEARTBEAT.md`, `MEMORY.md`, and `memory/YYYY-MM-DD.md`).
- Confirm provider and model support for prompt caching and memory search to avoid proposing unsupported keys.

### 2) Baseline token sources
- Break input cost into buckets: system prompt, tool schema, workspace files, memory files, and conversation history.
- Use a rough sizing method if exact token counts are unavailable (e.g., characters/4 as a quick estimate) and call out that the estimate is approximate.

### 3) Input reduction (highest ROI)
- Trim workspace files first. Target budgets:
  - `AGENTS.md`: keep only essential agent rules and policies.
  - `SOUL.md`: reduce to short persona bullets.
  - `MEMORY.md`: keep durable facts only; archive the rest.
  - `memory/YYYY-MM-DD.md`: prune or rotate daily logs.
- Remove unused workspace injections in config (e.g., if `TOOLS.md` or `IDENTITY.md` is unused).
- Prefer memory search over full-file injection for large memories. If using qmd, index only needed paths.

### 4) Cache and context control
- Enable prompt caching for the primary model when supported. Set `cacheRetention` to a long window and keep a consistent system prompt to maximize cache hits.
- Configure heartbeat to keep the cache warm (e.g., ~55 minutes), using a low-cost model and a minimal heartbeat prompt.
- Enable context pruning with a TTL that matches the cache window to prevent unbounded history growth.
- Add compaction with memory flush so long sessions preserve durable decisions while clearing history.

### 5) Call reduction
- Audit cron and scheduled tasks. Consolidate overlapping checks, reduce frequency, and move non-creative tasks to cheaper models.
- Configure delivery to be on-demand or only on change to avoid no-op calls.

### 6) Model strategy
- Default to a cost-effective model for routine work and provide aliases for manual upgrades to premium models.
- Use subagents for parallel, isolated tasks with cheaper models to avoid bloating the main context.

### 7) Deliverables
Provide:
- A short audit summary and estimated savings.
- A concrete config patch or JSON snippet for `openclaw.json`.
- A list of files to trim, with before/after size targets.
- A phased rollout plan (quick wins first, then advanced options).

## References
- Use `references/openclaw-token-optimization.md` for configuration snippets, checklists, and qmd guidance.

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

相关榜单

看看同类产品的完整排名:

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