Token导航 LogoToken导航

Agent Skill · 研究检索

openclaw-cost-optimization(OpenClaw cost optimization 部署)

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

openclaw-cost-optimization 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有未通过项,按安装量在研究检索类的 73,675 个 Skill 里排第 43,825。

总安装 955周安装 39GitHub Stars 2下载 309核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/iammarcin/cc4life --skill openclaw-cost-optimization

这个 Skill 是做什么的

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

openclaw-cost-optimization 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词快速定位候选结果时使用。适用于成本优化、资源调度和部署效率提升的研究任务场景。

通过关键词和来源仓库筛选,Agent 可返回相关文档或代码片段供进一步分析。安装前建议确认权限范围和维护状态,注意是否会触发联网或文件读写操作。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/openclaw-cost-optimization

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/iammarcin/cc4life --skill openclaw-cost-optimi…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

openclaw-cost-optimization 怎么安装?

在终端执行 npx skills add https://github.com/iammarcin/cc4life --skill openclaw-cost-optimization。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

openclaw-cost-optimization 支持哪些 AI 工具?

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

openclaw-cost-optimization 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

openclaw-cost-optimization 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

openclaw-cost-optimization 用的人多吗?

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

openclaw-cost-optimization 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

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

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 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-cost-optimization

OpenClaw cost optimization 部署 · 本页

9552接触敏感数据未明确未通过

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

SKILL.md 原文

OpenClaw Cost Optimization

Your OpenClaw setup is probably burning money on three things: using expensive models for trivial tasks, re-processing the same static files on every message, and loading context the agent never touches.

The default config optimizes for capability. That's fine when you're exploring. But once you're running 24/7, it's the difference between $1,500/month and $150/month or even less.

This skill audits your current setup and applies six optimizations in order of impact. Most take under 5 minutes. Combined, they cut costs by roughly 97% without reducing quality where it matters.


What Claude Gets Wrong Without This

Left to its own defaults, an OpenClaw agent will:

  • Run Sonnet or Opus for "what's the weather?" — that's a Haiku job
  • Load 50KB of context at session start when 8KB would do
  • Send heartbeat checks to a paid API 96 times a day
  • Re-process your SOUL.md and USER.md at full price on every single message
  • Let a search loop burn $20 overnight with no guardrails

None of these are bugs. They're just defaults that weren't designed for 24/7 autonomous operation.


The Six Optimizations

Ordered by impact. Start at #1 and work down.

1. Route the Right Model to the Right Job

Impact: $40-300/month saved depending on usage

This is the single biggest lever. Your agent handles many different types of work — chat, heartbeats, coding, web crawling, image analysis — and each has a model that hits the sweet spot of quality vs cost. Using Opus for a heartbeat check is like hiring a surgeon to take your temperature.

The model routing map:

TaskBest (no budget)Budget alternativeSavings
Chat (brain)Opus 4.6Kimi K2.5Massive — near-Opus intelligence, slightly less personality
Heartbeat checksHaiku 4.5Haiku 4.5 (+ reduce frequency)~$50/month
Coding / overnight devCodex GPT-5.2Miniax 2.1~$250/month on long coding runs
Web browsing / crawlingOpus 4.6DeepSeek V3Hundreds/month if you crawl a lot
Image understandingOpus 4.6Gemini 2.5 FlashSignificant — Flash is very capable on vision
Routine tasksHaiku 4.5Haiku 4.510x cheaper than Sonnet

The key insight: You're not picking ONE cheap model. You're building a roster where each task gets the cheapest model that handles it well.

Default model — set your daily driver to Haiku or Kimi depending on how much personality matters:

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "anthropic/claude-haiku-4-5"
      }
    }
  }
}

Model aliases — define aliases in agents.defaults.models so cron jobs and agents can reference models by short name:

{
  "agents": {
    "defaults": {
      "models": {
        "anthropic/claude-haiku-4-5": { "alias": "haiku" },
        "anthropic/claude-sonnet-4-5": { "alias": "sonnet" },
        "anthropic/claude-opus-4-6": { "alias": "opus" },
        "openai/codex-gpt-5.2": { "alias": "code" },
        "deepseek/deepseek-v3": { "alias": "crawl" },
        "google/gemini-2.5-flash": { "alias": "vision" }
      }
    }
  }
}

Heartbeat frequency matters too. Default is often every 10 minutes. If you're running Opus for heartbeats, that's ~$2/day / ~$54/month just on "anything need attention?" checks. Switch to Haiku AND reduce frequency to every hour:

{
  "heartbeat": {
    "every": "1h",
    "model": "anthropic/claude-haiku-4-5"
  }
}

That alone drops heartbeat costs to $0.01-0.10/day.

Add to your agent's SOUL.md or system prompt:

## Model Selection
Default: Haiku for routine tasks.
Escalate to Sonnet/Opus only for: architecture decisions, code review, security analysis, complex reasoning.
For coding sessions: prefer Codex or dedicated coding model.
For web crawling: use DeepSeek V3.
For image analysis: use Gemini Flash.
When uncertain, try the cheaper model first.

The model follows this as a behavioral constraint. No code changes needed.


2. Cache Stable Context

Impact: up to 90% discount on repeated tokens

Every message re-reads SOUL.md, USER.md, tool definitions, and reference docs. These files don't change between requests. Without caching, you're paying full price to re-process identical content dozens of times a day.

Anthropic's prompt caching charges 10% for cached tokens on reuse. For content you send repeatedly, that's a 90% cut on your most frequent cost.

What to cache (stable, rarely updated):

  • SOUL.md — personality, rules
  • USER.md — user profile, preferences
  • TOOLS.md — tool definitions
  • Reference docs, project specs

What NOT to cache (changes frequently):

  • Daily memory files
  • Conversation history
  • Tool outputs, search results

Config — set cacheRetention per model in agents.defaults.models:

{
  "agents": {
    "defaults": {
      "models": {
        "anthropic/claude-opus-4-6": {
          "alias": "opus",
          "params": { "cacheRetention": "short" }
        }
      }
    }
  }
}
ValueCache DurationNotes
"none"No cachingDisables prompt caching
"short"5 minutesDefault for API key auth
"long"1 hourRequires beta flag
Note: OpenClaw automatically applies "short" (5-min cache) when using Anthropic API key authentication. You only need to set this explicitly if you want "long" or "none".

Tips for maximizing cache hits:

  • Batch related requests within the cache window (5 min for short, 1h for long)
  • Align heartbeat frequency just under the cache TTL (e.g., every 4 min for short, every 55 min for long) to keep caches warm
  • Don't edit SOUL.md mid-conversation — each change invalidates the cache
  • Keep stable content at the top of your context hierarchy

3. Start Sessions Lean

Impact: ~$0.35 saved per session, $10-15/month with frequent use

Many setups eagerly load everything at startup: full memory archives, past conversations, every reference file. Most of it sits unused.

Load only what the agent needs to be itself and understand today:

Load at startupSkip at startup
SOUL.mdFull conversation history
USER.mdPast memory archives
IDENTITY.mdResearch docs from old projects
Today's memory fileOther agents' files

For everything else: pull on demand. When a topic comes up that needs historical context, use memory search:

"Search my memory for what we discussed about the marketing campaign"

Semantic search retrieves the relevant passages without loading the entire history. This is both cheaper and more effective — targeted retrieval beats brute-force loading.

Add to your agent's instructions:

## Session Startup
Load ONLY: SOUL.md, USER.md, IDENTITY.md, today's memory file.
For prior context: use memory_search() on demand. Don't pre-load history.

Result: Sessions start with ~8KB of context instead of 50KB+. The agent is faster, cheaper, and paradoxically better — less noise in the context means more focused responses.


4. Route Heartbeats to a Local Model

Impact: $5-15/month saved

Heartbeats are periodic checks — "anything need attention?" — that run every 15-60 minutes. They're simple tasks that don't need frontier reasoning. But by default, each one is a paid API call.

Route them to a free local model via Ollama instead.

Setup:

# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh

# Pull a lightweight model (2GB, handles heartbeat tasks easily)
ollama pull llama3.2:3b

Config:

{
  "heartbeat": {
    "model": "ollama/llama3.2:3b"
  }
}

Why it works: Heartbeat tasks are classification problems — "is there something that needs attention?" A 3B parameter model running locally answers this with zero issues. The quality difference from Sonnet is nonexistent for yes/no monitoring, and the cost drops to zero on your API bill.

Requirements: A machine running Ollama with ~2GB free RAM. If OpenClaw already runs on a home server or VPS, you have this.


5. Set Rate Limits and Budget Caps

Impact: prevents $50-200/month in runaway costs

AI agents can loop. A search spawns follow-up searches. A debugging session fires dozens of API calls in seconds. Without guardrails, a single runaway interaction can burn through a day's budget in minutes.

Add to SOUL.md or system prompt:

## API Discipline
- 5 seconds minimum between consecutive API calls
- 10 seconds minimum between web searches
- Max 5 searches per batch, then pause 2 minutes
- If a task needs more than 10 API calls, ask before continuing
- On rate limit error (429): stop, wait 5 minutes, retry once

Budget discipline via behavioral rules:

OpenClaw doesn't have a native budget config key. Instead, enforce limits through your agent's instructions and external monitoring:

  1. Set Anthropic API spend alerts — configure billing alerts directly in Anthropic Console or your provider dashboard
  2. Add behavioral limits to SOUL.md (see above) — the agent will self-regulate
  3. Monitor with the CLI:
openclaw cron list --all --json  # Check what's running and on which model
  1. Track via Anthropic usage dashboard — review daily/weekly spend patterns

Rate limits prevent waste during normal operation. Provider-level budget alerts catch edge cases. Together: predictable spending without limiting capability.


6. Trim Your Workspace Files

Impact: incremental but compounding — saves on every single request

SOUL.md, USER.md, and similar files load on every interaction. Every unnecessary line costs tokens not once, but on every message. A 200-line SOUL.md that could be 80 lines is silently 2-3x more expensive than it needs to be on your highest-frequency cost.

The audit question for each line: "Does the agent need this to do its job?"

What stays:

  • Core personality (2-3 sentences, not paragraphs)
  • Hard behavioral rules that change output
  • Communication preferences
  • Operational constraints

What goes:

  • Backstory or lore (move to a reference doc, load on demand)
  • Redundant restatements of the same rule
  • Verbose explanations of things Claude already knows
  • "Nice to have" context that doesn't affect responses

Before (bloated, 85 tokens):

## Communication Style
You should always communicate in a way that is clear, concise, and helpful.
When talking to the user, make sure your responses are well-structured and easy
to follow. Use bullet points when listing things. Don't write overly long
responses unless the topic genuinely requires depth. The user values efficiency.

After (lean, 22 tokens):

## Style
Direct and concise. Use structure for complex answers. Match depth to the question.

Same behavior. One-fourth the cost, multiplied by every message.


Combined Impact

OptimizationMonthly SavingsSetup Time
Default to Haiku$40-605 min
Prompt caching$15-302 min
Lean startup context$10-1530 min
Local heartbeats$5-1515 min
Rate limits + budgets$50-200 (prevention)10 min
Trim workspace files$5-101 hour

From $1,500+/month to $30-50/month.

Model routing and caching deliver the biggest absolute savings. Workspace trimming compounds over time because it reduces cost on every interaction.


How to Apply This

You don't need to hand-edit JSON files for most of these. Tell your OpenClaw agent:

"Switch your default model to Haiku. Only use Sonnet for complex reasoning tasks."
"Enable prompt caching — set cacheRetention to 'long' for my Anthropic models."
"Add API discipline rules to my SOUL.md — rate limits, search batching, and escalation thresholds."
"Audit my SOUL.md and USER.md — flag anything that doesn't directly affect your output quality."

OpenClaw can modify its own config in most cases. Just ask.


Verifying It Works

Verification Commands

Check actual model per cron job (the table view hides this — you MUST use JSON):

openclaw cron list --all --json

Look at each job's payload.model field. Don't assume from the agent assignment — cron jobs can override the agent's default model.

Check heartbeat status per agent (config is in ~/.openclaw/openclaw.json):

cat ~/.openclaw/openclaw.json | python3 -c "
import json,sys; c=json.load(sys.stdin)
d=c['agents']['defaults'].get('heartbeat',{}).get('every','')
print(f'Default: {d or \"(disabled)\"}')
for a in c['agents']['list']:
    e=a.get('heartbeat',{}).get('every',d)
    print(f'{a[\"id\"]}: {e or \"(disabled)\"}')
"

Agents without a heartbeat block inherit the default. An agent running on Opus with every: "15m" inherited = your biggest cost line.

Check bootstrap context size:

wc -c SOUL.md USER.md AGENTS.md MEMORY.md

What Good Looks Like

  • Context size: Should be 2-8KB at session start, not 50KB+
  • Default model: Should show Haiku, not Sonnet
  • Cron jobs: Each job's payload.model should match its complexity (Haiku for checkers, Sonnet for structured tasks, Opus only for creative/complex work)
  • Heartbeat: Should route to Ollama/local or Haiku at minimum
  • Daily costs: Should drop to $0.10-0.50 range within the first day

If costs haven't dropped, the most common issue is the system prompt not loading the model selection rules. Verify your SOUL.md changes are being picked up.

Common Audit Mistake

Don't infer cron job models from the agent assignment. openclaw cron list table shows Agent: sherlock but the job itself may override the model in its payload. Always check openclaw cron list --all --json for the actual payload.model field.


Anti-Patterns

"I'll just use Haiku for everything, including complex tasks." Don't. Haiku is fast and cheap but genuinely worse at multi-step reasoning, nuanced analysis, and creative work. The goal is right-sizing, not downgrading. Escalate when quality matters.

"I'll cache everything to save money." Caching volatile content (daily notes, tool outputs) wastes the cache slot and provides no benefit. Cache only what's stable.

"I'll set the budget to $1/day to be safe." Too aggressive. Your agent will hit the cap during legitimate work and stop mid-task. Start at $5/day, observe for a week, then adjust based on actual patterns.

"I trimmed SOUL.md to 10 lines and now the agent acts weird." You cut too deep. Some personality and behavioral rules genuinely affect output quality. Trim the fat, keep the muscle. If behavior degrades, add back the specific rule that was controlling it.


Quality Check

Before sharing this config with others:

  • Default model is Haiku (not Sonnet/Opus)
  • Caching enabled for stable files
  • Session startup loads only essentials
  • Heartbeat routes to local model (or cheapest available)
  • Budget caps set with warning threshold
  • Workspace files audited for unnecessary content
  • Agent behavior verified — no quality regression on important tasks

平台分布

Codex

35.42%
按下载量换算109

Claude

30.32%
按下载量换算94

Cursor

16.57%
按下载量换算51

Gemini CLI

8.31%
按下载量换算26

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

可疑

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

继续浏览同类 Skills