LaunchKit · 2026
Back to Skills

session-health-monitor

Context window health monitoring for OpenClaw agents — threshold warnings via Telegram, pre-compaction snapshots.

0
347 downloads
by @assistantheinrich-prog

Setup & Installation

openclaw skills install @assistantheinrich-prog/session-health-monitor

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install session-health-monitor

Version History

v1.1.0Feb 23, 2026 - Version note by skill developer:

**Added Telegram threshold warnings, clarified OpenClaw agent integration, and updated setup instructions.** - Agents now warn about high context usage directly in Telegram messages via contextual footers at YELLOW/RED thresholds. - Setup instructions updated for OpenClaw: add shared skill references and message footer logic. - Statusline integration and Claude Code–specific content removed; focus is on agent loop, Telegram workflow, and OpenClaw support. - Troubleshooting updated for Telegram footers and shared skill references. - No script/code changes; documentation only.

What This Skill Does

Monitors context window usage in OpenClaw agent sessions and sends threshold-based warnings via Telegram. When usage is high or compaction is detected, the agent saves key facts and decisions to a daily memory file. Old memory files are archived automatically to prevent directory clutter.

Context compaction is silent by default; this surfaces usage and compaction events in real time and preserves key facts before they disappear from the agent's memory.

When to use it

  • Getting Telegram alerts when an agent context window hits 75%
  • Saving decisions and changed files before a long session ends
  • Detecting when context was silently compacted mid-task
  • Auto-archiving old memory snapshots after a configurable number of days
  • Tracking compaction count across a multi-hour automation run

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: check session health and send me a Telegram update

AGENT
  1. 1Runs `bash scripts/context-check.sh --json` to get current usage percentage and compaction count
  2. 2Evaluates result: 63% used, 1 compaction detected, YELLOW threshold triggered
  3. 3Extracts 3-5 key facts from the current session (decisions made, files changed, blockers)
  4. 4Runs `bash scripts/snapshot.sh` to write facts to today's memory file
  5. 5Appends footer `📊 63% Context Window | 1x compacted` to the outgoing Telegram message
OUTPUT

Telegram message sent with context health footer; facts saved to memory/YYYY-MM-DD.md

Requirements

Accounts, API keys, or tools you or your AI assistant may need to set up while using this skill.

Telegram bot token (obtained from BotFather)Telegram chat ID for the target conversation