← 返回
AI智能 中文

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.
通过分区、压缩前检查点及信息生命周期管理,优化OpenClaw上下文窗口使用。适用于上下文接近上限(>80%)、压缩后出现“记忆丢失”,或需降低长时任务token成本与延迟的场景。
sarielwang93
AI智能 clawhub v1.0.0 1 版本 99793.2 Key: 无需
★ 6
Stars
📥 4,706
下载
💾 469
安装
1
版本
#latest

概述

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.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 13:32 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,365 📥 319,360
ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。适用于以下场景:创建/查询实体(人物、项目、任务、事件、文档)、关联相关对象、强制执行约束、将多步操作规划为图谱变换,或当技能需要共享状态时。触发关键词包括"记住""我知道关于什么""将X链
★ 716 📥 244,347
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,066 📥 802,758