session-health-monitor
Context window health monitoring for OpenClaw agents — threshold warnings via Telegram, pre-compaction snapshots, and memory rotation.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/assistantheinrich-prog/session-health-monitorWhat This Skill Does
The session-health-monitor is a vital diagnostic and management utility for OpenClaw agents. Its primary function is to provide real-time telemetry regarding the agent's context window usage. By tracking percentage-based capacity and compaction history, it empowers agents to manage their own memory longevity. It automatically triggers 'Pre-Compaction Snapshots'—a feature that captures critical progress, technical decisions, and file changes before the internal LLM context is compressed or cleared. Additionally, it implements a smart notification system via Telegram, ensuring that the human supervisor remains aware of session health, preventing unexpected task termination due to overflow.
Installation
- Add the skill reference to your
shared/INDEX.mdfile:| Context window health, compaction detection, pre-compaction snapshots | skill-session-health.md |. - Create the documentation file
shared/skill-session-health.mdusing the provided template to define the thresholds and behavioral expectations for the agent. - Integrate the heartbeat step into your agent's primary execution loop to ensure the
session_statusfunction is called consistently. - Run the installation command in your terminal:
clawhub install openclaw/skills/skills/assistantheinrich-prog/session-health-monitor.
Use Cases
- Long-running Development Tasks: When working on complex codebases, agents often reach context limits. This skill ensures key logic and TODOs are saved to memory before context loss occurs.
- Autonomous Research Agents: Useful for agents scouring the web, as it tracks context growth and archives findings before session truncation.
- Remote Session Stability: Provides an early-warning system for users via Telegram, so they know exactly when a session requires a restart or manual memory cleanup.
Example Prompts
- "Check the current session-health-monitor status and tell me if I need to perform a cleanup before starting this refactor."
- "Review the last three pre-compaction snapshots and summarize the key decisions made during the session."
- "Summarize the current context window usage and confirm if the Telegram notifications are active for current thresholds."
Tips & Limitations
- Proactive Management: Do not ignore the RED status notifications; if the agent flags urgency, perform a memory reset or snapshot immediately to avoid losing context-sensitive state.
- Storage Hygiene: The memory rotation feature helps keep your repository clean, but ensure you have an external backup if your agent is processing mission-critical data.
- Threshold Tuning: While the defaults are safe for most workflows, you can tune the thresholds in the
skill-session-health.mdfile if your specific task requires a different sensitivity level for compaction warnings.
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-assistantheinrich-prog-session-health-monitor": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read, code-execution