跳到正文
TakoAPI
返回技能列表

context-budgeting

由 sarielwang93 提供

Coding Agents & IDEs
2.1k下载量由 clawskills.sh 提供
4星标
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Manage and optimize OpenClaw context window usage via partitioning, pre-compression checkpointing, and information.

描述

该技能的功能

A framework for managing context window usage in OpenClaw agents. It partitions context into defined zones (goals, history, decisions, background knowledge), checkpoints state before compaction, and runs a cleanup script to recover capacity without restarting the session.

Checkpointing to HOT_MEMORY.md before compaction preserves task state that standard compaction would otherwise discard, allowing the agent to resume accurately.

何时使用

  • Preventing memory loss during long multi-step coding sessions
  • Recovering task state after automatic context compaction
  • Reducing token costs on extended agent workflows
  • Managing multi-megabyte JSON outputs without flooding the context
  • Keeping long-running agents on track past the 80% context threshold

示例工作流

输入

User asks: Keep my refactoring task going after the context fills up

智能体
  1. 1

    Check current context usage via /status

  2. 2

    Confirm context exceeds 80% threshold

  3. 3

    Update memory/hot/HOT_MEMORY.md with current status, key decisions made, and next step

  4. 4

    Execute scripts/gc_and_checkpoint.sh to clear raw data and finalize compaction

  5. 5

    Resume the task using the checkpoint as the new working context

输出

Task continues from the last checkpoint without losing prior decisions or progress

安装

clawhub install sarielwang93/context-budgeting

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接