session-guard
Prevents and recovers from OpenClaw session bloat and context loss. Use when: (1) diagnosing why main session context was lost or truncated, (2) setting up isolated heartbeat/monitoring to avoid session pollution, (3) detecting OpenClaw restarts and rehydrating context automatically, (4) auditing whether built-in heartbeat is causing session file bloat, (5) configuring safe compaction settings, (6) any mention of session reset, context lost, output cut off, or heartbeat pollution.
Why use this skill?
Stop OpenClaw session resets and memory bloat. Session Guard provides isolated heartbeats and automated health monitoring to keep your agent context stable.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/bowen31337/session-guardWhat This Skill Does
Session Guard is a robust infrastructure management tool for OpenClaw that solves the critical architectural flaw where internal heartbeat processes pollute the main conversation session. By disabling the default heartbeat, Session Guard prevents rapid file bloat, session corruption, and silent context resets. It offloads heartbeat tasks to an isolated, lightweight process, monitors session health via cron-based watchdogs, and automatically hydrates the session if a reset is detected. This ensures that your agent's core memory remains pristine and focused, preventing the system from wiping away days of progress due to log saturation.
Installation
The recommended way to deploy Session Guard is via the One-Shot installer, which configures the system in a single step: python3 skills/session-guard/scripts/install.py. This script is fully idempotent and will auto-detect your existing OpenClaw configuration. For granular control, you can use flags like --dry-run to preview changes or --crit-mb to customize your session size limits. Alternatively, install directly from the repository using clawhub install openclaw/skills/skills/bowen31337/session-guard. Always run python3 skills/session-guard/scripts/audit.py post-installation to verify that the configurations are correctly applied and that no lingering heartbeat processes are active in the main thread.
Use Cases
- Preventing Context Loss: Critical for long-running agents that suffer from silent session wipes after 2-3 days of uptime.
- Optimizing Memory Management: Ideal for agents with complex instructions that are susceptible to truncation when the session file exceeds 10MB.
- Silent Monitoring: Useful when you need to maintain heartbeat pulses (alerting) without cluttering the primary conversation logs with redundant status checks.
- Automated Recovery: Ensures the agent resumes functionality immediately if an underlying system error triggers a session restart.
Example Prompts
- "Run the Session Guard audit to check if my session file size is approaching the corruption threshold."
- "Install Session Guard with a 4MB critical threshold and use the qwen2.5-7b model for the monitor cron."
- "My context keeps disappearing every night; please configure Session Guard to monitor and rehydrate my session automatically."
Tips & Limitations
- Model Selection: Always use lighter, cheaper models (like proxies or 7B-class models) for heartbeat and monitor crons to keep overhead low. Avoid using large, expensive models for routine maintenance checks.
- Compatibility: Ensure your gateway URL and token are correctly defined in
~/.openclaw/openclaw.jsonbefore running the installer. - Disclaimer: While Session Guard handles heartbeat isolation, it cannot fix external API errors caused by empty string forwarding; however, it removes the primary cause of these errors by offloading the task.
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-bowen31337-session-guard": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read, code-execution, external-api
Related Skills
Terse
Skill by bowen31337
Identity Resolver
Skill by bowen31337
whalecli
Agent-native whale wallet tracker for ETH and BTC chains. Track large crypto wallet movements, score whale activity, detect accumulation/distribution patterns, and stream real-time alerts. Integrates with FearHarvester and Simmer prediction markets for closed-loop signal→bet workflows. Use when: user asks about whale activity, on-chain signals, large wallet movements, smart money flows, or when pre-validating crypto trades/bets with on-chain data.
agent-self-governance
Self-governance protocol for autonomous agents: WAL (Write-Ahead Log), VBR (Verify Before Reporting), ADL (Anti-Divergence Limit), VFM (Value-For-Money), and IKL (Infrastructure Knowledge Logging). Use when: (1) receiving a user correction — log it before responding, (2) making an important decision or analysis — log it before continuing, (3) pre-compaction memory flush — flush the working buffer to WAL, (4) session start — replay unapplied WAL entries to restore lost context, (5) any time you want to ensure something survives compaction, (6) before claiming a task is done — verify it, (7) periodic self-check — am I drifting from my persona? (8) cost tracking — was that expensive operation worth it? (9) discovering infrastructure — log hardware/service specs immediately.
pyright-lsp
Python language server (Pyright) providing static type checking, code intelligence, and LSP diagnostics for .py and .pyi files. Use when working with Python code that needs type checking, autocomplete suggestions, error detection, or code navigation.