LaunchKit · 2026
Back to Skills

context-budgeting

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

4
2.1k downloads
by @sarielwang93

Setup & Installation

openclaw skills install @sarielwang93/context-budgeting

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install context-budgeting

What This Skill Does

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.

When to use it

  • 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

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

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

AGENT
  1. 1Check current context usage via /status
  2. 2Confirm context exceeds 80% threshold
  3. 3Update memory/hot/HOT_MEMORY.md with current status, key decisions made, and next step
  4. 4Execute scripts/gc_and_checkpoint.sh to clear raw data and finalize compaction
  5. 5Resume the task using the checkpoint as the new working context
OUTPUT

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