context-guardian
Proactive context monitoring with smart 3-level alerts. Know when to restart before quality degrades.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/brucey0017-cloud/context-guardianContext Guardian š”ļø
Your context guardian. Alerts before errors happen.
Proactive context monitoring that warns you at 60%, 70%, and 85% usage ā before context pollution causes errors and hallucinations.
Why You Need This
The Problem:
- Long conversations lead to context pollution
- Quality degrades silently as context fills up
- You don't know when to restart until it's too late
- Errors and hallucinations increase after ~70% usage
The Solution:
- Continuous monitoring of context usage
- Smart 3-level alerts (ā ļø 60%, š 70%, š“ 85%)
- Actionable suggestions at each level
- Prevents duplicate alerts
Quick Start
For Agents: Heartbeat Integration
When you receive a heartbeat poll, include this check:
- Call
session_statustool to get current context usage - Parse the context percentage from the output
- Compare against thresholds: 60% (warning), 70% (danger), 85% (critical)
- If threshold exceeded and not a duplicate alert, display the appropriate alert message
- Update state file to track alert history
Implementation:
During heartbeat:
1. Get context usage from session_status
2. Check if usage >= 60%, 70%, or 85%
3. Load state from memory/context-guardian-state.json
4. Determine if alert should be sent (prevent duplicates)
5. If yes, display alert and update state
For Users: Enable in HEARTBEAT.md
Add to your HEARTBEAT.md:
## Context Monitoring
- Check context usage
- Alert if thresholds exceeded (60%, 70%, 85%)
The agent will automatically handle the rest.
How It Works
Monitoring
The skill calls session_status to check your current context usage percentage.
Alert Levels
ā ļø Warning (60%)
ā ļø Context: 60%
Getting full. Consider wrapping up or starting fresh soon.
š Danger (70%)
š Context: 70%
Pollution risk rising. Recommend:
⢠Finish current task
⢠Start new session for next task
⢠Or compress with context-optimizer
š“ Critical (85%)
š“ Context: 85% - CRITICAL
High error risk. STRONGLY recommend:
⢠Save work
⢠Start new session NOW
⢠Quality degradation likely
Smart Duplicate Prevention
The skill tracks alert history and only alerts when:
- First time reaching a threshold
- Alert level upgrades (60% ā 70% ā 85%)
- Usage drops below threshold then rises again
Configuration
Edit config/default.json or create config/user.json:
{
"enabled": true,
"checkInterval": "heartbeat",
"thresholds": {
"warning": 60,
"danger": 70,
"critical": 85
},
"alertMethod": "message",
"alertStyle": "emoji",
"preventDuplicates": true,
"trackHistory": true,
"suggestions": {
"autoSuggest": true,
"suggestCompression": true,
"suggestRestart": true
}
}
Options
checkInterval:
"heartbeat"- Check during heartbeat polls (default)"cron"- Independent cron job (future)number- Check every N minutes (future)
Metadata
Not sure this is the right skill?
Describe what you want to build ā we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-brucey0017-cloud-context-guardian": {
"enabled": true,
"auto_update": true
}
}
}Tags
Related Skills
health-guardian
Proactive health monitoring for AI agents. Apple Health integration, pattern detection, anomaly alerts. Built for agents caring for humans with chronic conditions.
afrexai-observability-engine
Complete observability & reliability engineering system. Use when designing monitoring, implementing structured logging, setting up distributed tracing, building alerting systems, creating SLO/SLI frameworks, running incident response, conducting post-mortems, or auditing system reliability. Covers all three pillars (logs/metrics/traces), alert design, dashboard architecture, on-call operations, chaos engineering, and cost optimization.
openclaw-security-monitor
Proactive security monitoring, threat scanning, and auto-remediation for OpenClaw deployments
cron-doctor
Diagnose and triage cron job failures. Checks job states, identifies error patterns, prioritizes by criticality, generates health reports. Triggers on: cron failures, job health check, scheduled task errors, cron diagnosis, job not running, backup failed.
qa-check
Mandatory quality assurance for all dev work before publishing. Use BEFORE deploying any project to production. Validates build, tests browser functionality, checks mobile responsiveness, and ensures no broken links/images.