2.5k
GitHub Stars
2
Bundled Files
2 months ago
Catalog Refreshed
3 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill openclaw/skills --skill context-guard- _meta.json284 B
- SKILL.md5.7 KB
Overview
This skill is an automated context-management protocol that prevents memory loss, slowdowns, and token waste for OpenClaw agents and sub-agents. It continuously monitors context waterline, enforces partitioned budgeting, performs mandatory checkpoints before overload, and restores state after compression. It triggers on heartbeat or session start to keep sessions resilient and restartable.
How this skill works
The skill inspects session context usage via session_status and maps utilization to a five-zone waterline. It enforces a fixed context budget across core instructions, recent dialogue, decision logs, background knowledge, and a buffer, and automatically triggers a checkpoint workflow when thresholds are hit. On session compression or restart it reads status and memory files and reconstructs a concise working context so agents resume without asking the user.
When to use it
- Always run on heartbeat or session start to evaluate context usage.
- Before performing heavy actions (browser scraping, large tool outputs, or lengthy research).
- When context reaches the pre-warning threshold (50%) to trigger automatic checkpointing.
- When spawning sub-agents to isolate heavy tasks and avoid main-session bloat.
- On detecting a compressed or new session to run the recovery flow.
Best practices
- Strictly partition context: keep core instructions small, recent dialogue prioritized, large tool outputs summarized and discarded.
- Run session_status regularly and act by the waterline table: trim, checkpoint, notify, or halt as specified.
- Always create a STATUS.md checkpoint with precise next steps and key data before reset.
- Write daily memory append files for critical decisions and findings; avoid noisy logs.
- Limit sub-agent retries to 3 and enforce single access to the shared browser profile to prevent contention.
Example use cases
- A browsing sub-agent collects dozens of pages: extract key facts, write checkpoint, then discard raw HTML to free context.
- Long-running multi-step tasks: periodically checkpoint progress to STATUS.md and memory files so the main agent can be reset safely.
- When context spikes during an interactive session, the agent compresses nonessential content and sends a concise STATUS.md to trigger a safe reset.
- After an automatic compression summary starts a new session, the agent reads memory and status files and resumes without prompting the user.
FAQ
At 50% the agent must perform the full checkpoint workflow: STATUS.md, append daily memory, update long-term memory if needed, and notify Russ for /new.
Can an agent reset itself?
No. Agents must archive and request a manual /new from Russ; they may optionally downgrade model if reset is unavailable.