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.
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 4 · 2.2k · 19 current installs · 21 all-time installs
MIT-0
Security Scan
OpenClaw
Suspicious
medium confidencePurpose & Capability
The SKILL.md and the script clearly expect an 'openclaw' CLI to exist and to operate on a local workspace (memory/hot/HOT_MEMORY.md), but the skill declares no required binaries or environment variables. A legitimate 'context budgeting' helper would reasonably require the OpenClaw CLI (or document how compaction is triggered). The script also hard-codes WORKSPACE="/Users/yang/clawd", which is a personal path and unlikely to be correct for most users.
Instruction Scope
The instructions require updating HOT_MEMORY.md and running the provided shell script; they also state a heartbeat should check '/status' every 30m and 'clear raw data' once summaries are extracted. 'Clear raw data' is underspecified (could imply deletion of large files) and the /status endpoint is not defined. The included script itself does not perform deletions (the find cleanup line is commented out), so the prose and the executable are not fully consistent.
Install Mechanism
There is no install spec (instruction-only plus a small script), which minimizes supply-chain risk. The only shipped code is a 917-byte bash script; it contains no network downloads or obfuscated code. That said, the script invokes an external CLI and uses a hard-coded filesystem path — things to validate locally before running.
Credentials
The skill claims no required env vars or credentials, yet it assumes filesystem access to a workspace and the presence of the 'openclaw' CLI. Requesting no credentials is fine, but the hard-coded path and implicit expectation of local-file writes/reads are unannounced and could lead to the agent touching user files unexpectedly if run.
Persistence & Privilege
always is false and there is no install-time mechanism to persist or auto-enable the skill. The script does not modify other skills or system-wide configuration. Autonomous invocation is allowed by default (normal) but not a unique risk here.
What to consider before installing
This skill is plausible for managing OpenClaw context, but review and adjust before using. Specific steps to take: (1) Confirm you have a real 'openclaw' CLI and that its commands are as the script expects; (2) Change the hard-coded WORKSPACE path to a safe, correct workspace for your environment (do not run with the included '/Users/yang/...' path unless that's yours); (3) Inspect and clarify the heartbeat '/status' check — where that endpoint lives and what it returns — before enabling periodic automated runs; (4) Demand explicit, non-destructive rules for 'clearing raw data' (avoid any automatic deletion until you test it in a sandbox); (5) Test the script in a disposable environment to verify it only reads/writes intended memory files and does not touch unrelated user data; (6) Ask the publisher to declare the 'openclaw' binary dependency in the skill metadata and to remove or parameterize any personal hard-coded paths. If you cannot verify these items, run the skill only in an isolated sandbox or do not install it.Like a lobster shell, security has layers — review code before you run it.
Current versionv1.0.0
Download ziplatest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
SKILL.md
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:
- Generate Checkpoint: Update
memory/hot/HOT_MEMORY.mdwith:- Status: Current task progress.
- Key Decision: Significant choices made.
- Next Step: Immediate action required.
- Run Automation: Execute
scripts/gc_and_checkpoint.shto 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.mdto finalize the compaction process without restarting the session.
Integration with Heartbeat
Heartbeat (every 30m) acts as the Garbage Collector (GC):
- Check
/status. If Context > 80%, trigger the Checkpointing procedure. - Clear raw data (e.g., multi-megabyte JSON outputs) once the summary is extracted.
Files
2 totalSelect a file
Select a file to preview.
Comments
Loading comments…
