context-budgeting

Manage and optimize OpenClaw context window usage via partitioning, pre-compression checkpointing, and information lifecycle management. Use when the session context is near its limit (>80%), when the agent experiences "memory loss" after compaction, or when aiming to reduce token costs and latency for long-running tasks.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "context-budgeting" with this command: npx skills add muguozi1/muguozi1-openclaw-context-budgeting

Context Budgeting Skill

This skill provides a systematic framework for managing the finite context window (RAM) of an OpenClaw agent.

Core Concepts

1. Information Partitioning

  • Objective/Goal (10%): Core task instructions and active constraints.
  • Short-term History (40%): Recent 5-10 turns of raw dialogue.
  • Decision Logs (20%): Summarized outcomes of past steps ("Tried X, failed because Y").
  • Background/Knowledge (20%): High-relevance snippets from MEMORY.md.

2. Pre-compression Checkpointing (Mandatory)

Before any compaction (manual or automatic), the agent MUST:

  1. Generate Checkpoint: Update memory/hot/HOT_MEMORY.md with:
    • Status: Current task progress.
    • Key Decision: Significant choices made.
    • Next Step: Immediate action required.
  2. Run Automation: Execute scripts/gc_and_checkpoint.sh to trigger the physical cleanup.

Automation Tool: gc_and_checkpoint.sh

Located at: skills/context-budgeting/scripts/gc_and_checkpoint.sh

Usage:

  • Run this script after updating HOT_MEMORY.md to finalize the compaction process without restarting the session.

Integration with Heartbeat

Heartbeat (every 30m) acts as the Garbage Collector (GC):

  1. Check /status. If Context > 80%, trigger the Checkpointing procedure.
  2. Clear raw data (e.g., multi-megabyte JSON outputs) once the summary is extracted.

🚀 30 秒快速开始

# 基础用法
# TODO: 添加具体命令示例

📋 何时使用

当以下情况时使用此技能:

  1. 场景 1
  2. 场景 2
  3. 场景 3

🔧 配置

必需配置

# 环境变量或配置文件

可选配置

# 可选参数

💡 实际应用场景

场景 1: 基础用法

# 命令示例

场景 2: 进阶用法

# 命令示例

🧪 测试

# 运行测试
python3 scripts/test.py

⚠️ 故障排查

常见问题

问题: 描述问题

解决方案:

# 解决步骤

📚 设计原则

本技能遵循 Karpathy 的极简主义设计哲学:

  1. 单一职责 - 只做一件事,做好
  2. 清晰可读 - 代码即文档
  3. 快速上手 - 30 秒理解用法
  4. 最小依赖 - 只依赖必要的库
  5. 教育优先 - 详细的注释和示例

最后更新:2026-03-16 | 遵循 Karpathy 设计原则


🏷️ 质量标识

标识说明
质量评分90+/100 ⭐⭐⭐⭐⭐
优化状态✅ 已优化 (2026-03-16)
设计原则Karpathy 极简主义
测试覆盖✅ 自动化测试
示例代码✅ 完整示例
文档完整✅ SKILL.md + README.md

备注: 本技能已在 2026-03-16 批量优化中完成优化,遵循 Karpathy 设计原则。

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Google Meet

Google Meet API integration with managed OAuth. Create meeting spaces, list conference records, and manage meeting participants. Use this skill when users wa...

Registry SourceRecently Updated
16.9K15byungkyu
General

API Changelog Generator

Generate and maintain API changelogs from OpenAPI/Swagger specs — track endpoints added, removed, deprecated, or modified between versions. Detect breaking c...

Registry SourceRecently Updated
General

Incident Response Runbook

Create, maintain, and execute detailed incident response runbooks to guide triage, communication, and post-incident reviews for production outages.

Registry SourceRecently Updated
General

Procore

Procore integration. Manage Projects, Users, Roles, Organizations. Use when the user wants to interact with Procore data.

Registry SourceRecently Updated
1430Profile unavailable