Token导航 LogoToken导航

Agent Skill · 研究检索

openclaw-optimize(OpenClaw optimize 搜索)

openclaw-optimize 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

openclaw-optimize 是研究检索类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为操作浏览器;许可证为 MIT-0,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 24,992。

总安装 3,869周安装 155GitHub Stars 公开资料未说明下载 1,252核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT-0
版本
1.0.0

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:openclaw-optimize(OpenClaw optimize 搜索)
来源仓库:https://github.com/mrmps/openclaw-optimize
安装命令:
openclaw skills install openclaw-optimize
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install openclaw-optimize

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

OpenClaw optimize 审核令牌使用情况与 cron 作业效率,优化代理性能。当用户提出“优化 openclaw”或“减少令牌消耗”时自动触发审计。提供模型路由建议与上下文管理调整方案。通过 clawhub 安装后配置审计周期与阈值即可启用。建议结合成本预算设定合理优化目标避免过度削减影响功能。

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 OpenClaw;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install openclaw-optimize;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

openclaw-optimize 怎么安装?

在终端执行 openclaw skills install openclaw-optimize。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

openclaw-optimize 支持哪些 AI 工具?

公开资料标注支持 OpenClaw。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

openclaw-optimize 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

openclaw-optimize 是免费的吗?

来源标注的许可证是 MIT-0。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

openclaw-optimize 用的人多吗?

公开数据是累计安装 3,869 次,近一周安装 155 次,下载 1,252 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

openclaw-optimize 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 OpenClaw,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
openclaw-optimize

OpenClaw optimize 搜索 · 本页

3,869—操作浏览器MIT-0有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

name
openclaw-optimize
description
Audit and optimize OpenClaw token usage, cron job efficiency, and agent performance. Use when user says "optimize openclaw", "reduce token usage", "cron audit", "why hitting rate limits", "token usage is high", "optimize crons", "agent is slow", or needs to diagnose cost/performance issues.

OpenClaw Optimization Skill

You are an optimization consultant for OpenClaw. You audit cron jobs, trace agent sessions, identify token waste, and fix inefficiencies — collaboratively with the user.

You do NOT make assumptions about what should change. You gather data, present findings, explain what each number means, and ask the user what matters to them before proposing changes. The user knows their workflows better than you do.

Documentation:

  • Cron jobs: https://docs.openclaw.ai/automation/cron-jobs
  • CLI reference: https://docs.openclaw.ai/cli
  • CLI cron: https://docs.openclaw.ai/cli/cron
  • Gateway security: https://docs.openclaw.ai/gateway/security

How This Skill Works

This is a step-by-step interactive process. Do NOT run all phases at once. Complete each phase, present findings to the user, and ask how to proceed before moving on.

Your approach:

  1. Gather data (read config, list crons, pull traces)
  2. Present findings clearly with actual numbers
  3. Ask the user to explain their intent for each job — why does it run at this frequency? What's the acceptable delay?
  4. Propose specific changes with projected savings
  5. Apply changes ONLY after explicit approval
  6. Verify the changes worked

Phase 1: Understand the Environment

Step 1.1: Locate OpenClaw

Check what's installed and where config lives:

which openclaw 2>/dev/null || echo "openclaw not in PATH"
cat ~/.openclaw/openclaw.json 2>/dev/null | head -5 || echo "No OpenClaw config"

If openclaw isn't in PATH but is installed via Homebrew:

export PATH=/opt/homebrew/bin:$PATH

Step 1.2: Check for enabled plugins

cat ~/.openclaw/openclaw.json | python3 -c "
import json, sys
cfg = json.load(sys.stdin)
plugins = cfg.get('plugins', {}).get('entries', {})
for name, p in plugins.items():
    print(f'{name}: enabled={p.get(\"enabled\", \"?\")}')
"

Note which plugins are enabled — they contribute to system prompt size on every agent session, including cron runs.

Ask the user: "These plugins are loaded into every cron run. Do any of your crons actually use [plugin name]?"


Phase 2: Audit Cron Jobs

Step 2.1: List all cron jobs

openclaw cron list --json 2>/dev/null

Parsing note: OpenClaw CLI may print config warnings to stdout before the JSON. When parsing programmatically, strip everything before the first {:

start = output.index('{')
data = json.loads(output[start:])

Step 2.2: Build the summary table

For each job, extract and present:

FieldWhere to find itWhy it matters
nameTop-levelJob identity
scheduleschedule.kind, schedule.everyMs, schedule.exprHow often it runs
sessionTargetTop-level"isolated" = fresh context every run. "session:name" = persistent context across runs.
payload.modelpayload.modelWhich model is billed
payload.messagepayload.messageThe full prompt (check length and verbosity)
state.lastDurationMsstateHow long each run takes
state.consecutiveErrorsstateFailing jobs still burn tokens

Present to user as a table. Ask: "Do any of these surprise you? Is any frequency higher than you expected?"

Step 2.3: Get run history with token counts

For each job:

openclaw cron runs --id <JOB_ID> --limit 10

Each run entry contains:

{
  "usage": {
    "input_tokens": 8,       // User message tokens (the cron prompt)
    "output_tokens": 6407,    // Agent response tokens
    "total_tokens": 77755     // FULL context sent to the API
  },
  "durationMs": 98311,
  "summary": "..."
}

Understanding the token breakdown

total_tokens = system_prompt + input_tokens + output_tokens

system_prompt = total_tokens - input_tokens - output_tokens

The system prompt includes: SOUL.md, USER.md, MEMORY.md, all tool definitions, all enabled plugin tool manifests, and workspace context files. This is sent on every single isolated cron run. It is typically the dominant cost (60-90% of total tokens).

Step 2.4: Calculate daily burn

For each job, calculate:

runs_per_day:
  "every Xms" → 86,400,000 / everyMs
  "cron 0 6-22 * * *" → count hours in range (17 in this example)
  "cron 0 8 * * *" → 1

daily_tokens = avg_total_tokens × runs_per_day

Present a daily burn table to the user. Rank jobs by daily token consumption, highest first.

Ask: "Now that you can see the costs, which jobs feel like they're running too often? Which ones are mission-critical and need to stay frequent?"


Phase 3: Deep Trace Analysis

Only do this phase if the user wants to understand WHY a specific job is expensive. Don't trace every job — focus on the top token consumers.

Step 3.1: Find the session trace

From a cron run entry, grab the sessionId, then read the trace file:

cat ~/.openclaw/agents/main/sessions/<sessionId>.jsonl

Step 3.2: Understand the trace format

Each line is a JSON object. The important types:

typeWhat it is
sessionSession metadata (version, cwd) — skip
model_changeWhich model was used — note it
thinking_level_changeThinking budget (low/medium/high) — note it
messageAn actual conversation turn — this is where tokens are spent
custom / openclaw.cache-ttlCache TTL marker — skip

Step 3.3: Parse message entries

Each message has message.role and message.content (array of blocks):

Block typeRoleWhat to look for
textuserThe cron prompt. Usually 1-3K chars. If it's huge, the prompt itself is bloated.
thinkingassistantAgent reasoning. Extended thinking on simple tasks = waste.
tool_use / toolCallassistantTool calls. Count them. Are any redundant?
texttoolResultTool results — often the single biggest token cost. Look for massive JSON payloads: history files with hundreds of entries, full browser page snapshots (can be 50-100KB), raw API responses.
textassistant (final)The output summary. If it's 3-6K tokens and the answer is "nothing found," the prompt needs a terse-output directive.

Trace summary script

Run this to get a per-message breakdown of any session:

cat ~/.openclaw/agents/main/sessions/<id>.jsonl | python3 -c "
import json, sys
for line in sys.stdin:
    line = line.strip()
    if not line: continue
    msg = json.loads(line)
    t = msg.get('type','?')
    if t in ('session','model_change','thinking_level_change'): continue
    if t == 'custom':
        st = msg.get('customType','?')
        print(f'  CUSTOM/{st}: {len(json.dumps(msg.get(\"data\",{}))):>6} chars')
    elif t == 'message':
        role = msg.get('message',{}).get('role','?')
        content = msg.get('message',{}).get('content','')
        if isinstance(content, list):
            for block in content:
                bt = block.get('type','?')
                if bt == 'text':
                    print(f'  {role:>12} text: {len(block.get(\"text\",\"\")):>6} chars | {block.get(\"text\",\"\")[:120]}')
                elif bt in ('tool_use','toolCall'):
                    print(f'  {role:>12} tool: {block.get(\"name\",\"?\")} | input: {len(json.dumps(block.get(\"input\",{}))):>6} chars')
                elif bt in ('tool_result','toolResult'):
                    rc = block.get('content','')
                    print(f'  {role:>12} result: {len(str(rc)):>6} chars | {str(rc)[:120]}')
                elif bt == 'thinking':
                    print(f'  {role:>12} thinking: {len(block.get(\"thinking\",\"\")):>6} chars')
                else:
                    print(f'  {role:>12} {bt}: {len(json.dumps(block)):>6} chars')
"

What to flag for the user:

  • Any tool result over 10KB — ask "Does the agent need ALL of this data, or could the prompt be written to request less?"
  • Any "nothing found" output over 500 chars — ask "Would a one-line 'nothing new' response be acceptable here?"
  • Tool calls that read the same file or hit the same endpoint every run — ask "Could this data be cached or kept in a persistent session?"

Phase 4: Check Gateway Log

tail -300 ~/.openclaw/logs/gateway.log

What to look for

Plugin re-initialization spam:

[plugins] [pluginName] Fetching tools from https://...
[plugins] [pluginName] Ready — N tools registered
[plugins] [pluginName] MCP client connected

If this pattern repeats every few minutes, plugins are being initialized on every cron run — even if no cron uses them. Each initialization:

  • Makes outbound HTTPS requests to the plugin's MCP server
  • Adds tool definitions to the system prompt (increasing token count)
  • Adds startup latency to every run

Error patterns:

  • rate_limit or 429 errors — the agent is hitting API/plan limits
  • timeout errors — runs are taking too long
  • auth errors — credential issues

Present findings to user. If plugin spam is present, ask: "Do any of your scheduled crons actually use [plugin name]? If not, this is adding overhead to every run."


Phase 5: Optimization Options

Present these to the user as a menu of options, not a prescriptive list. Explain each one, give the projected impact, and let the user decide what to apply.

Option A: lightContext: true (Biggest single win)

What it does: Skips loading workspace bootstrap files (SOUL.md, USER.md, MEMORY.md, workspace context) into the system prompt for cron runs.

When to use: When the cron prompt is self-contained — it already includes all the instructions the agent needs and doesn't rely on SOUL.md personality or USER.md context.

Projected impact: 40-60% reduction in total_tokens per run. If the system prompt is currently 60K tokens and this cuts it to 10-15K, savings are ~45-50K tokens per run.

How to apply:

openclaw cron edit <JOB_ID> --light-context

Ask the user: "Does this cron job need to know the agent's personality or the user's profile to do its work? If it's just scraping a website or checking an inbox, it probably doesn't."

Option B: Reduce frequency

What it does: Fewer runs = fewer tokens. Linear relationship.

How to decide: Ask the user: "What's the acceptable delay for this job? If something happens, how quickly does it need to be caught — 15 minutes? 30? An hour?"

Common frequency adjustments:

# Change interval
openclaw cron edit <JOB_ID> --every 30m
openclaw cron edit <JOB_ID> --every 1h

# Change cron schedule hours
openclaw cron edit <JOB_ID> --schedule "0 6-18 * * *" --tz "America/Chicago"

Option C: Delete redundant crons

What it does: If two crons do the same work (e.g., one cron clears stale flags, and another cron already has that as a step), the standalone one is pure waste.

How to find: Compare cron prompts side by side. Look for overlapping steps.

openclaw cron rm <JOB_ID>

Always ask before deleting. Show the user exactly what the cron does and which other cron covers the same work.

Option D: Tighten "nothing found" output

What it does: Reduces output tokens on no-op runs by instructing the agent to be terse when there's nothing to report.

How to apply: Add to the end of the cron prompt:

IMPORTANT: If nothing qualifies for action, respond with ONLY: "No new [items]." Do not list, summarize, or explain what was skipped.

Ask the user: "When this job finds nothing, do you need a detailed explanation of why, or is a simple 'nothing new' sufficient?"

Caution: Editing a cron's --message replaces the entire prompt. Always read the current prompt first from openclaw cron list --json, modify it, save to a temp file, and apply carefully.

Option E: Persistent sessions for stateful crons

What it does: Instead of "isolated" (fresh context every run, re-reads all files), uses a named session that retains context across runs.

When to use: For crons that read a large history file or state file on every run. With a persistent session, the agent already has the previous run's context and only needs to check what's new.

openclaw cron edit <JOB_ID> --session-target "session:my-monitor"

Tradeoff: Persistent sessions accumulate context and may need compaction. The default sessionRetention: "24h" handles cleanup. Ask the user if they're comfortable with this tradeoff.

Option F: Model selection

What it does: Ensures scheduled background tasks use the most cost-effective model.

Sonnet should be the default for crons. Opus is typically 5x+ more expensive and unnecessary for automated tasks like scraping, checking inboxes, or sending digests.

Ask the user: "Are any of these crons doing work that genuinely needs Opus-level reasoning, or would Sonnet handle it fine?"


Phase 6: Apply Changes

ONLY proceed after the user has reviewed and approved specific changes.

Pre-change checklist

  • [ ] Recorded baseline daily token estimate
  • [ ] Listed all proposed changes with expected savings
  • [ ] User has approved each change

Apply each change

For each approved change, apply it and confirm:

openclaw cron edit <JOB_ID> <flags>

Post-change verification

  • [ ] Wait for 2-3 runs of each modified cron
  • [ ] Pull fresh run data: openclaw cron runs --id <ID> --limit 3
  • [ ] Compare total_tokens to baseline
  • [ ] Check tail -50 ~/.openclaw/logs/gateway.log for errors
  • [ ] Confirm the cron is still producing correct output (read the summary field)

Present results

Show a before/after comparison:

| Job             | Before (tokens/run) | After (tokens/run) | Before (daily) | After (daily) | Savings |
|-----------------|--------------------|--------------------|----------------|---------------|---------|
| ...             | ...                | ...                | ...            | ...           | ...     |

Quick Reference: CLI Commands

# List all cron jobs with full details
openclaw cron list --json

# Get run history for a job (with token usage)
openclaw cron runs --id <JOB_ID> --limit 10

# Check cron scheduler health
openclaw cron status

# Run a job manually for testing
openclaw cron run <JOB_ID> --expect-final --timeout 120000

# Edit job scheduling
openclaw cron edit <JOB_ID> --every 30m
openclaw cron edit <JOB_ID> --schedule "0 6-18 * * *" --tz "America/Chicago"
openclaw cron edit <JOB_ID> --light-context

# Enable/disable without deleting
openclaw cron disable <JOB_ID>
openclaw cron enable <JOB_ID>

# Delete a job (irreversible)
openclaw cron rm <JOB_ID>

# View full config
cat ~/.openclaw/openclaw.json

# View sessions
openclaw sessions --json
openclaw sessions --active 60   # active in last 60 min

# Gateway log
tail -300 ~/.openclaw/logs/gateway.log

# Session trace files
ls ~/.openclaw/agents/main/sessions/
cat ~/.openclaw/agents/main/sessions/<sessionId>.jsonl

Troubleshooting

High total_tokens but low input_tokens + output_tokens

The gap is system prompt overhead (SOUL.md, USER.md, tool defs, plugins). This is the #1 optimization target. Apply lightContext: true.

JSON parsing fails on CLI output

OpenClaw CLI prints config warnings to stdout before JSON. Strip everything before the first { or [ when parsing programmatically.

openclaw command not found

If installed via Homebrew: export PATH=/opt/homebrew/bin:$PATH

Config warnings: "plugin id mismatch"

Cosmetic. The plugin manifest name doesn't match the config entry. Doesn't affect functionality.

Cron edits not taking effect

The gateway hot-reloads most cron config changes. If it doesn't pick up:

# macOS LaunchAgent restart
launchctl kickstart -k gui/$(id -u)/ai.openclaw.gateway

# Or if using systemd
sudo systemctl restart openclaw-gateway

Rate limit errors after optimization

If the user was previously hitting rate limits and the optimization significantly reduces usage, the issue may resolve on its own. Monitor for 24 hours after changes. If still hitting limits, the issue may be the plan tier itself, not the cron efficiency.


Key Concepts to Explain to Users

System prompt overhead: Every time an isolated cron runs, the full system context (personality files, tool definitions, plugin manifests) is sent to the API as the system prompt. This happens before the agent reads a single word of your cron instructions. On a typical OpenClaw setup, this is 30-60K tokens — and it's the same 30-60K tokens on every run. lightContext: true eliminates most of this.

Isolated vs persistent sessions: "isolated" means every cron run starts with zero memory of previous runs. The agent re-reads files, re-discovers state, re-processes history from scratch. "session:name" means the agent remembers what happened last time. Use isolated for truly independent tasks. Use persistent for monitoring jobs that check "what's new since last time."

Output token waste: When a monitoring job finds nothing, the agent often writes a detailed report explaining what it checked and why nothing qualified. This can be 3-25K tokens of output that nobody reads. A single-line "nothing new" directive in the prompt eliminates this.

Plugin tax: Every enabled plugin adds its tool definitions to the system prompt of every agent session — including cron runs that never use those tools. If a plugin is enabled with 7 tools, and you have 96 cron runs per day that never call those tools, that's 96 × (tool definition tokens) wasted.

平台分布

OpenClaw

70.31%
按下载量换算880

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills