2.6k
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 session-health-monitor- _meta.json490 B
- SKILL.md6.3 KB
Overview
This skill monitors Claude Code session context window health, detects compactions, captures pre-compaction snapshots, and rotates daily memory files to prevent clutter. It provides a statusline indicator, standalone health checks, snapshot saving, and automatic memory rotation with sensible defaults.
How this skill works
The skill reads context usage and tracks sudden drops to infer compactions, exposing a color-coded status (GREEN/YELLOW/RED) and compact count. When thresholds are reached it can run a snapshot routine to write 3–5 key facts to a dated memory file and a rotator to archive older files, all configurable via environment variables.
When to use it
- During long interactive Claude Code sessions to avoid losing important context
- In agent loops or CI heartbeat checks to monitor context window health
- Before ending sessions that have accumulated significant context
- After detected compactions to capture state and decisions
- When you want a visible status indicator in the Claude Code status bar
Best practices
- Trigger a pre-compaction snapshot at first YELLOW threshold or immediately after compaction
- Save 3–5 concise facts: decisions, changed files, blockers, and next steps
- Keep KEEP_DAYS conservative (default 3) then increase if you need longer archives
- Append the context footer on messages at YELLOW+ to inform users of session health
- Run the context-check script in a periodic heartbeat to catch compactions early
Example use cases
- Developer debugging a persistent issue: snapshot decisions and files before compaction
- Automated agent loop: run context-check and snapshot when usage crosses thresholds
- Team collaboration: statusline shows session health so collaborators know when to restart
- CI or monitoring: exit codes from health checks feed into automation rules
- Long design sessions: rotate daily memory files to prevent directory clutter
FAQ
The skill tracks used percentage over time and flags a compaction when usage drops by the configured COMPACTION_DROP percent, incrementing a compaction count.
When should I run snapshots?
Run snapshots when context reaches 50% (YELLOW) for the first time, after any compaction, before ending long sessions, or whenever significant context accumulates.