Context Budget Guard
SkillMonitoring & opsProactively monitors estimated token usage during long sessions and triggers context-window-management before overflow, not after. Use at the start of any session expected to last more than 30 minutes.
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
Then ask your AI: use the Context Budget Guard skill
What this skill tells your AI
The instructions your AI receives, as published by archieindian/openclaw-superpowers in skills/openclaw-native/context-budget-guard/SKILL.md and read by ahel’s review.
State file: ~/.openclaw/skill-state/context-budget-guard/state.yaml
Don't wait for the model to go incoherent. Act at 70%, not 95%.
When to Use
- At the start of any long-running session (>30 min expected)
- Before each major task step in a multi-hour workflow
- When
long-running-task-managementadvances to a new stage
The Process
Step 1: Initialize (Session Start)
Write to state: session_start timestamp, compaction_count: 0, status: monitoring, threshold_pct: 70.
Step 2: Check Budget (Before Each Major Step)
Estimate current context usage as a rough percentage:
- Low (<50%) — continue normally
- Medium (50–70%) — note in state, proceed with caution (avoid loading large files)
- High (>70%) — trigger
context-window-managementNOW, before continuing
To estimate: count approximate tokens from recent messages, loaded file contents, and active task context.
Step 3: After Compaction
- Increment
compaction_countin state - Write
last_compacted_at,strategy_used(passed fromcontext-window-management) - Reset mental estimate to ~20% (post-compaction baseline)
Step 4: Session End
Update state: status: idle, session_end timestamp.
Key Principles
- The 70% threshold is the trigger — earlier is always better than later
- Check budget BEFORE loading large files or running subagents, not after
- If in doubt: compact. A clean context costs less than a confused one.
- Works best paired with
long-running-task-management— check budget at every checkpoint
Signals
- GitHub stars
- 72
- Forks
- 14
- Last commit
- May 2026
Advanced
- Item type
- skill
- Key
context-budget-guard- Source
- github.com/archieindian/openclaw-superpowers
github.com/archieindian/openclaw-superpowers
Related picks
Skill · wshobson
The pick for Pythonpython-pro
Skill · jeffallan
The pick for Pythoninternal-comms
Skill · anthropics
More in Monitoring & opsagent-eval
Skill · affaan-m
More in Monitoring & opsarchitecture-decision-records
Skill · affaan-m
More in Monitoring & opsbabysit
Skill · thedotmack
More in Monitoring & ops