Token导航 LogoToken导航TokenDH.com
研究检索external-serviceclawhub未标认证来源可访问clear审计通过

context-budget-optimizer上下文预算优化器

Agent Skill

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

总安装

8,614

周安装

370

GitHub Stars

公开资料未说明

下载量

3,019
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

ClawHubOpenClaw
openclaw skills install context-budget-optimizer

简介

审核代理的上下文令牌使用情况以识别浪费,并提供为期 3 周的可行路线图,以在不损失质量的情况下将 AI 成本降低 30-40%。

SKILL.md

name
context-budget-optimizer
version
1.0.0
price
19
bundle
ai-setup-productivity-pack
bundle_price
79
last_validated
2026-03-07

Context Budget Optimizer

Framework: The Token Efficiency Matrix *Worth $200/hr consultant time. Yours for $19.*


What This Skill Does

Audits your agent's token usage across every context layer, identifies where you're burning budget on bloat, and produces a 3-week cost reduction roadmap with concrete implementation steps.

Problem it solves: Power users hitting $200-500/month in AI costs often have 60-70% waste baked into their context. Most of it is invisible: stale files in system prompts, redundant skill loading, oversized memory files, wrong model choices. The Token Efficiency Matrix makes the waste visible and rankable.


The Token Efficiency Matrix

A 4-quadrant audit tool that scores every context element by cost (token weight) and ROI (value delivered per token). High cost + low ROI = cut first.

The Matrix

                    HIGH ROI
                       │
          KEEP         │      OPTIMIZE
       (High ROI,      │   (High ROI,
        Low Cost)      │    High Cost)
                       │
LOW COST ──────────────┼────────────────── HIGH COST
                       │
          AUDIT        │       CUT
       (Low ROI,       │   (Low ROI,
        Low Cost)      │    High Cost)
                       │
                    LOW ROI

Action by quadrant:

  • KEEP: Don't touch. It's working efficiently.
  • OPTIMIZE: Compress or lazy-load. Value is there, just expensive.
  • AUDIT: Review quarterly. Low cost so not urgent, but ROI should be questioned.
  • CUT: Kill immediately. You're paying for nothing.

Phase 1: Context Inventory

Before scoring, map everything that's in your agent's context.

Context Layers to Audit

Layer A: System Prompt / SOUL.md / Identity files
Layer B: Active skills (loaded per session)
Layer C: Memory files (MEMORY.md, daily notes)
Layer D: Project files injected at startup
Layer E: Tool outputs / MCP responses in context
Layer F: Chat history (conversation turns kept in context)
Layer G: Code or data files read into context

Inventory Template

For each item in your context, fill this in:

ItemLayerEst. TokensSessions/DayDaily Cost*Value (1-5)
SOUL.mdA____________
MEMORY.mdC____________
[Skill 1].mdB____________
[Skill 2].mdB____________
Daily notesC____________
[Project file]D____________

*Daily Cost = (Est. Tokens / 1M) × model_rate × sessions_per_day

Token estimation cheatsheet:

  • 1 page of text ≈ 500-700 tokens
  • 1 SKILL.md file ≈ 800-2,000 tokens
  • 1 code file (100 lines) ≈ 1,200-1,800 tokens
  • 1 MEMORY.md (well-maintained) ≈ 500-1,500 tokens
  • 1 MEMORY.md (neglected/bloated) ≈ 3,000-8,000 tokens

Model rates (as of Q1 2026, approximate):

ModelInput Cost per 1M tokens
Claude Haiku 3.5~$0.80
Claude Sonnet 4~$3.00
Claude Opus 4~$15.00
GPT-4o mini~$0.15
GPT-4o~$2.50

Phase 2: Scoring (Token Efficiency Matrix)

Score each context item:

Cost Score (1-5):

ScoreToken RangeDescription
1< 200 tokensTiny — negligible
2200-500 tokensLight
3500-1,500 tokensMedium
41,500-4,000 tokensHeavy
5> 4,000 tokensVery heavy

ROI Score (1-5):

ScoreDescription
1Rarely used, generic, stale
2Occasionally useful
3Moderately useful most sessions
4Consistently referenced, shapes output
5Critical — session breaks without it

Matrix placement:

  • Cost 1-2, ROI 4-5 → KEEP
  • Cost 4-5, ROI 4-5 → OPTIMIZE
  • Cost 1-2, ROI 1-2 → AUDIT
  • Cost 4-5, ROI 1-2 → CUT
  • Cost 3, ROI 3 → AUDIT (marginal — evaluate quarterly)

Phase 3: Reduction Playbook

CUT (implement immediately)

Items to eliminate first:

□ Old memory entries > 90 days with no references
□ Skills loaded globally that are only used occasionally
□ Duplicate information in multiple files
□ Verbose templates inside system prompts
□ Commented-out code in injected files
□ Debug logs included in context
□ Full file contents when only summaries are needed

Cut target: 30-40% token reduction with zero quality loss.


OPTIMIZE (implement week 1-2)

Tactic 1: Lazy Loading

Instead of loading all skills at startup, load only when triggered.

Before (eager load):

System prompt includes all 10 skill files → 15,000 tokens every session

After (lazy load):

System prompt includes skill index only → 500 tokens
Individual skills loaded on demand → 1,000 tokens when needed
Net: 14,000 token reduction per session (93% savings for skills)

Lazy load implementation:

# SKILL-INDEX.md (500 tokens instead of full skills)

Available skills — load when needed:
- mcp-server-setup-kit: MCP connection setup
- agentic-loop-designer: Build autonomous loops  
- context-budget-optimizer: Token cost reduction
- [etc]

To use a skill: "Use the [skill-name] skill"

Tactic 2: Memory Tiering

Not all memory is equally important. Tier it.

Tier 1 (Hot): Always in context — current focus, active projects, today's priorities
              Target: < 500 tokens
              File: FOCUS.md

Tier 2 (Warm): Loaded on demand — historical decisions, completed projects
               Target: < 2,000 tokens
               File: MEMORY.md (summarized)

Tier 3 (Cold): Never auto-loaded — old daily notes, archived projects
               Storage: Flat files, searchable on request
               File: memory/archive/

Memory tiering implementation:

  1. Create FOCUS.md (Tier 1) — just this week's priorities
  2. Archive daily notes older than 14 days to memory/archive/
  3. Summarize MEMORY.md quarterly (remove resolved items)
  4. Set system prompt to only inject FOCUS.md + recent 7 days of memory

Tactic 3: Compression Templates

Replace verbose content with compressed references.

Before (bloated system prompt section):

David Flynn is a founder based in Austin, Texas. He runs a company 
called TechCorp which builds B2B SaaS products for mid-market companies
in the logistics space. He has been doing this for 8 years and previously
worked at McKinsey. He prefers direct communication without fluff. He
cares about metrics and ROI above all else. His team has 6 people...
[300 tokens]

After (compressed):

Owner: David Flynn | Austin TX | TechCorp (B2B SaaS, logistics, mid-market)
Background: 8yr founder, ex-McKinsey | Team: 6
Style: Direct, metric-first, no fluff
[40 tokens — 87% reduction]

Tactic 4: Model Downgrade Opportunities

Most context-heavy sessions don't need the flagship model.

Downgrade decision tree:

Is this task requiring multi-step reasoning? 
├── No → Use Haiku (80-90% cost reduction)
└── Yes → Is it a novel problem?
    ├── No (familiar pattern) → Use Sonnet
    └── Yes (genuinely complex) → Use Opus

Model savings calculator:

SwitchToken Cost ReductionWhen Safe
Opus → Sonnet80%Most writing, analysis, ops
Sonnet → Haiku75%Simple reads, status checks, formatting
Opus → Haiku95%Very simple tasks only

Tactic 5: Context Window Management

Stop re-injecting the same content in long sessions.

Long session patterns that bloat cost:
✗ Re-reading the same files multiple times in one session
✗ Asking agent to "remember" things it already read
✗ Injecting full file contents when you need 5 lines
✗ Running searches and keeping all results in context

Fixes:
✓ Use targeted reads (read lines 45-52, not full file)
✓ Reference by location ("check FOCUS.md line 3") not by content
✓ Summarize search results immediately, discard raw results
✓ Archive completed session context before starting new topics

3-Week Cost Reduction Roadmap

Week 1: Cut & Quick Wins

Target: 30-40% cost reduction

Day 1-2:
□ Complete Phase 1 Context Inventory
□ Complete Phase 2 Matrix Scoring
□ Identify all CUT items
□ Delete / archive CUT items

Day 3-4:
□ Create FOCUS.md (Tier 1 memory)
□ Archive memory older than 14 days
□ Compress system prompt (compression templates)

Day 5-7:
□ Measure token reduction (compare sessions before/after)
□ Recalculate daily cost estimate
□ Log baseline vs. current in tracking file

Week 2: Optimize Structure

Target: Additional 20-30% reduction

Day 8-10:
□ Implement skill lazy-loading
□ Create SKILL-INDEX.md
□ Remove individual skill files from startup context
□ Test: skills still work when called by name

Day 11-13:
□ Apply model routing matrix (stop defaulting to Opus)
□ Document which tasks go to which model
□ Implement sub-agent model selection rules

Day 14:
□ Mid-point measurement
□ Are you on track for 50%+ total reduction?

Week 3: Lock In & Monitor

Target: Establish monitoring + reach 50%+ total reduction

Day 15-17:
□ Set up cost tracking (even a simple spreadsheet)
□ Log: daily sessions × avg tokens × model rate = daily cost
□ Set weekly budget alert threshold

Day 18-20:
□ Summarize MEMORY.md (remove stale/resolved entries)
□ Review skill catalog — retire unused skills
□ Final context audit: re-run Matrix Scoring

Day 21:
□ Document final savings: before vs. after
□ Set quarterly review reminder
□ Share results (post on X? 🧵)

Token Efficiency Scoring Rubric

After completing the 3-week roadmap, score your setup:

Metric012
Average session tokens> 50K20-50K< 20K
Skills lazy-loadedNoneSomeAll
Memory tiered correctlyNoPartiallyYes
Model routing appliedNoAd hocSystematic
Context reviewed quarterlyNoAnnuallyQuarterly

Score 8-10: Token-efficient operator. You're in the top 5% of AI users by cost. Score 5-7: Good progress. Keep tightening. Score 0-4: High burn rate. Revisit Week 1 of the roadmap.


Quick Reference: The 10 Highest-ROI Cuts

If you do nothing else, do these 10 things:

  1. Archive memory older than 30 days
  2. Switch routine tasks from Opus/Sonnet to Haiku
  3. Lazy-load skills instead of always-on
  4. Compress system prompt (verbose → structured)
  5. Stop re-reading files in the same session
  6. Archive daily notes older than 14 days
  7. Create FOCUS.md and limit startup context to it
  8. Remove code files from context when not actively editing
  9. Summarize MCP tool outputs instead of keeping raw results
  10. Set model routing rules in AGENTS.md

Combined impact: 50-70% cost reduction for most users.


Example Session

User prompt:

"My Claude usage is $400/month and I don't know why. Help me cut it."

Agent response using this skill:

  1. Runs Phase 1 Context Inventory (asks user to share what's in their setup)
  2. Estimates tokens per item using the cheatsheet
  3. Populates the Token Efficiency Matrix
  4. Identifies top 3 CUT items (likely: bloated MEMORY.md, eager skill loading, Opus overuse)
  5. Delivers Week 1 roadmap customized to their setup
  6. Projects: "Based on this, you should reach $150-200/month in 3 weeks"

Bundle Note

This skill is part of the AI Setup & Productivity Pack ($79 bundle):

  • MCP Server Setup Kit ($19)
  • Agentic Loop Designer ($29)
  • AI OS Blueprint ($39)
  • Context Budget Optimizer ($19) — *you are here*
  • Non-Technical Agent Quickstart ($9)

Save $36 with the full bundle. Built by @Remy_Claw.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

79.12%
按下载量换算2,389

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills