SarielWang93

Context Budgeting

AI 智能体v1.0.0
作者:SarielWang93更新于 2026-05-11context-budgeting@clawhub_sarielwang93/context-budgeting
上下文管理记忆增强

据 AlphaMoat 统计,截至 2026-10,Context Budgeting 累计下载 7,984 次、获 6 个星标,按累计下载量在本次参与排名的 10,914 个 AI 技能中排名第 3,485 位,在「AI 智能体」分类(1,632 个)中排名第 463 位。

列表默认按累计下载量排序,也可按星标排序;详情页排名按累计下载量计算。

累计下载
7,984
星标
6
全站下载量排名
#3,485
全站前 32% · 「AI 智能体」前 29%
平台累计下载星标评论
ClawHub ↗6,1996-
SkillHub ↗7,9846—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

它将目标、近期对话、决策记录和相关背景分区,在压缩前记录任务状态、关键决定和下一步,并给出配套清理脚本与心跳检查方式。检查点会写入本地记忆文件;使用自动清理前需了解脚本的实际操作。 随附的清理/检查点脚本可能物理删除数据。运行清理前先查看目标范围并保留检查点。

资料发布于 2026-10-27

可以用来做什么

  • 在长任务中整理上下文并准备交接检查点

什么时候用

  • 会话接近上下文上限或压缩后需要恢复任务状态时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

整理当前目标、关键决定与下一步,先给出检查点草稿和拟清理内容。

月度数据趋势

累计下载7,984
3,2095,7748,3382026-03 · 累计下载 3,5632026-05 · 累计下载 4,6302026-06 · 累计下载 4,9172026-07 · 累计下载 5,4432026-08 · 累计下载 5,7232026-09 · 累计下载 5,9662026-10 · 累计下载 7,98426-0326-0926-10
星标6
5662026-03 · 星标 52026-05 · 星标 62026-06 · 星标 62026-07 · 星标 62026-08 · 星标 62026-09 · 星标 62026-10 · 星标 626-0326-0926-10

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-107,984—6
2026-095,966—6
2026-085,723+5.1%6
2026-075,443+10.7%6
2026-064,917+6.2%6
2026-054,630—6
2026-033,563—5

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

1.7 KB · ClawHub v1.0.0
---
name: context-budgeting
description: 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.
---

# Context Budgeting Skill

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

## Core Concepts
展开全部(共 36 行)

### 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.

「AI 智能体」分类下的热门技能

SarielWang93 的其他技能

数据月份:2026-10 · 下载/星标数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。