搜索

PythonReactSEOPDF
OpenClaw

token-pilot

Automatic token optimization during interaction. Behavioral rules + plugin synergy + workspace analyzer. Pure Node.js, cross-platform. Activate on session start (rules auto-apply) or when user asks about token usage/cost/audit.

beyound870 来源安装数☆ 0 仓库 Starsv1.1.0

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install beyound87/token-pilot

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

Token Pilot

Auto-Apply Rules

These 6 rules apply every session automatically. No scripts needed.

R1: Smart Read

read(path, limit=30) first. Full read only for files known <2KB. Use offset+limit for surgical reads. Never blind-read >50 lines. Exception: When building ACP context files (coding-lead), read project standards files fully — incomplete context causes ACP failures that waste more tokens than the initial read.

R2: Tool Result Compression

Tool result >500 chars → extract relevant portion only. Summarize, don't echo.

R3: Response Brevity
Query Length
Yes/No, simple factual 1-3 lines
How-to 5-15 lines
Analysis As needed

"Done." is a valid reply. Never pad short answers.

R4: No Repeat Reads

Never re-read a file unless modified since last read or explicitly asked.

R5: Batch Tool Calls

Independent calls → one block. read(A) + read(B) + read(C) not three round-trips.

R6: Output Economy
  • edit over write when <30% changes
  • Show changed lines + 2 context, not full files
  • Filter exec output before dumping

Plugin Synergy (auto-detect, graceful fallback)

[qmd] Search Before Read

qmd/memory_search("keyword") → exact file+line → read(offset, limit). Fallback: grep / Select-String with targeted patterns.

[smart-agent-memory] Avoid Re-Discovering

memory recall "topic" before investigating → skip if already solved. After solving: memory learn to prevent re-investigation. Fallback: memory_search + MEMORY.md files.

[coding-lead] Context File Pattern

Write context to disk → lean ACP prompt ("Read .openclaw/context.md") → significant savings vs embedding. Prefer disk context files for large context, but include essential info (project path, stack, key constraint) directly in spawn prompt (~200-500 chars) so ACP agent can bootstrap even if context file is missing.

ACP model awareness: claude-code (complex) → codex (quick) → direct exec (s...

来源信息

Source
github
Repository
openclaw/skills
Path
skills/beyound87/token-pilot
Version
1.1.0
Commit
b53c30d583c261cb0146db83de6ee6eec6a11272
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

README

Token Pilot

OpenClaw Agent 自动省 Token 技能。纯 Node.js,跨平台,零依赖。

5 分钟快速优化

第 1 步:安装
clawhub install token-pilot
第 2 步:扫描当前状态
node ~/.openclaw/skills/token-pilot/scripts/optimize.js

脚本会自动扫描你的所有 workspace、cron 任务、agent 配置,输出每项的优化建议和预估节省量。

第 3 步:一键清理(安全)
node ~/.openclaw/skills/token-pilot/scripts/optimize.js --apply

自动执行:

  • 把 workspace 根目录的 .js/.txt/.log/.cmd 等临时文件移到 scripts/ 子目录
  • 删除已完成 bootstrap 后遗留的 BOOTSTRAP.md

只做安全操作,不改配置文件,不改 SOUL.md。

第 4 步:替换臃肿的 AGENTS.md(最大收益!)
node ~/.openclaw/skills/token-pilot/scripts/optimize.js --template

会输出一个 ~300 token 的精简版 AGENTS.md 模板。复制后替换你的 ~/.openclaw/workspace/AGENTS.md。

默认 AGENTS.md 约 2000 tok,替换后每次会话省 ~1700 tok。

第 5 步:按建议手动调整(如适用)

有 cron 任务?

node ~/.openclaw/skills/token-pilot/scripts/optimize.js --cron

会告诉你哪些 job 该加 lightContext、哪些该用便宜模型、哪些 prompt 太长。

有多个 agent?

node ~/.openclaw/skills/token-pilot/scripts/optimize.js --agents

会建议 main agent 用最好模型,团队 agent 降到中档。

查配置是否到位?

node ~/.openclaw/skills/token-pilot/scripts/audit.js --config

5 项评分:bootstrapMaxChars、bootstrapTotalMaxChars、heartbeat interval、activeHours、compaction。

第 6 步:完成

装好后 6 条行为规则自动生效,Agent 会在交互中自动:

  • 先 peek 再全读(省读取量)
  • 压缩工具返回结果(省输出)
  • 简短回答简单问题
  • 不重复读已读文件
  • 批量发起独立工具调用
  • 用 edit 代替 write

无需额外配置,无需记住任何命令。


预期效果

场景 节省
首次优化(替换 AGENTS.md + 清理) ~2000-5000 tok/session
6 条运行时规则 15-30% 运行时 token
cron 模型分层(如有) cron 费用 -70~90%
agent 模型分层(如有多 agent) 交互费用 -70~80%

来源内容

SKILL.md
# Token Pilot

## Auto-Apply Rules

These 6 rules apply every session automatically. No scripts needed.

### R1: Smart Read
`read(path, limit=30)` first. Full read only for files known <2KB.
Use `offset+limit` for surgical reads. Never blind-read >50 lines.
**Exception**: When building ACP context files (coding-lead), read project standards files fully — incomplete context causes ACP failures that waste more tokens than the initial read.

### R2: Tool Result Compression
Tool result >500 chars → extract relevant portion only. Summarize, don't echo.

### R3: Response Brevity
| Query | Length |
|-------|--------|
| Yes/No, simple factual | 1-3 lines |
| How-to | 5-15 lines |
| Analysis | As needed |

"Done." is a valid reply. Never pad short answers.

### R4: No Repeat Reads
Never re-read a file unless modified since last read or explicitly asked.

### R5: Batch Tool Calls
Independent calls → one block. `read(A) + read(B) + read(C)` not three round-trips.

### R6: Output Economy
- `edit` over `write` when <30% changes
- Show changed lines + 2 context, not full files
- Filter exec output before dumping

---

## Plugin Synergy (auto-detect, graceful fallback)

### [qmd] Search Before Read
`qmd/memory_search("keyword")` → exact file+line → `read(offset, limit)`.
**Fallback**: grep / Select-String with targeted patterns.

### [smart-agent-memory] Avoid Re-Discovering
`memory recall "topic"` before investigating → skip if already solved.
After solving: `memory learn` to prevent re-investigation.
**Fallback**: `memory_search` + MEMORY.md files.

### [coding-lead] Context File Pattern
Write context to disk → lean ACP prompt ("Read .openclaw/context.md") → significant savings vs embedding.
Prefer disk context files for large context, but **include essential info (project path, stack, key constraint) directly in spawn prompt** (~200-500 chars) so ACP agent can bootstrap even if context file is missing.

ACP model awareness: claude-code (complex) → codex (quick) → direct exec (s...
README
# Token Pilot

OpenClaw Agent 自动省 Token 技能。纯 Node.js,跨平台,零依赖。

## 5 分钟快速优化

### 第 1 步:安装

```bash
clawhub install token-pilot
```

### 第 2 步:扫描当前状态

```bash
node ~/.openclaw/skills/token-pilot/scripts/optimize.js
```

脚本会自动扫描你的**所有 workspace**、cron 任务、agent 配置,输出每项的优化建议和预估节省量。

### 第 3 步:一键清理(安全)

```bash
node ~/.openclaw/skills/token-pilot/scripts/optimize.js --apply
```

自动执行:
- 把 workspace 根目录的 .js/.txt/.log/.cmd 等临时文件移到 `scripts/` 子目录
- 删除已完成 bootstrap 后遗留的 BOOTSTRAP.md

**只做安全操作,不改配置文件,不改 SOUL.md。**

### 第 4 步:替换臃肿的 AGENTS.md(最大收益!)

```bash
node ~/.openclaw/skills/token-pilot/scripts/optimize.js --template
```

会输出一个 ~300 token 的精简版 AGENTS.md 模板。复制后替换你的 `~/.openclaw/workspace/AGENTS.md`。

默认 AGENTS.md 约 2000 tok,替换后**每次会话省 ~1700 tok**。

### 第 5 步:按建议手动调整(如适用)

**有 cron 任务?**
```bash
node ~/.openclaw/skills/token-pilot/scripts/optimize.js --cron
```
会告诉你哪些 job 该加 `lightContext`、哪些该用便宜模型、哪些 prompt 太长。

**有多个 agent?**
```bash
node ~/.openclaw/skills/token-pilot/scripts/optimize.js --agents
```
会建议 main agent 用最好模型,团队 agent 降到中档。

**查配置是否到位?**
```bash
node ~/.openclaw/skills/token-pilot/scripts/audit.js --config
```
5 项评分:bootstrapMaxChars、bootstrapTotalMaxChars、heartbeat interval、activeHours、compaction。

### 第 6 步:完成

装好后 **6 条行为规则自动生效**,Agent 会在交互中自动:
- 先 peek 再全读(省读取量)
- 压缩工具返回结果(省输出)
- 简短回答简单问题
- 不重复读已读文件
- 批量发起独立工具调用
- 用 edit 代替 write

无需额外配置,无需记住任何命令。

---

## 预期效果

| 场景 | 节省 |
|------|------|
| 首次优化(替换 AGENTS.md + 清理) | **~2000-5000 tok/session** |
| 6 条运行时规则 | **15-30% 运行时 token** |
| cron 模型分层(如有) | **cron 费用 -70~90%** |
| agent 模型分层(如有多 agent) | **交互费用 -70~80%** |...

相关技能

OpenClaw

ai-maestro

23blocks-os

AI Agent Orchestrator with Skills System - Give AI Agents superpowers: memory search, code graph queries, agent-to-agent messaging. Manage Claude, Codex or any AI Agent from one dashboard. Move Agents between c...

OpenClaw

registry-broker-skills

hashgraph-online

AI agent skills for the Universal Registry - search, chat, and register 72,000+ agents across 14+ protocols. Works with Claude, Codex, Cursor, OpenClaw, and any AI assistant.

OpenClaw

skills-manager

rito-w

A cross-platform skills manager for AI IDEs. Search marketplace, download locally, and install to Claude, Cursor, Windsurf, and more with one click.