1---2name: session-watchdog3description: Session Watchdog4---56# Session Watchdog78Monitors context levels, warns before compaction, and saves checkpoints to preserve important information.910## Context Thresholds1112| Level | Tokens | Action |13|-------|--------|--------|14| Safe | 0-140k | Normal operation |15| **Warning** | 140k-160k | Warn user, save checkpoint |16| Critical | 160k-197k | Warn + stop unless urgent |17| Full | 197k+ | Compaction imminent |1819## Check Context2021Before each session and periodically during long conversations:2223```24session_status25```2627Check the `contextTokens` field from the response.2829## Checkpoint Protocol3031When approaching 80% (160k tokens):32331. **Save checkpoint to memory file:**34 - Read current memory/YYYY-MM-DD.md35 - Add key context: decisions, pending tasks, important details36 - Write back to memory file37382. **Alert user:**39 Say: "⚠️ Approaching context limit (~160k tokens). Saving checkpoint to memory before continuing."40413. **Ask user:**42 - Continue and accept compaction?43 - Summarize and restart fresh?44 - Pause until ready?4546## What to Save4748Essential information that must survive compaction:4950- **Decisions made** in this conversation51- **Pending tasks** not yet completed52- **Important context** (project state, configurations, preferences)53- **Files modified** and their paths54- **Unresolved issues** requiring follow-up5556## When to Trigger5758- At session start59- After every 30k tokens of conversation60- Before initiating large tasks (file edits, multiple operations)61- When user asks "how much context do we have left?"6263## Memory File Format6465```66# YYYY-MM-DD6768## Session Checkpoint (at X% context)6970### Decisions71- Decision 172- Decision 27374### Pending75- [ ] Task 176- [ ] Task 27778### Important Context79- Project state: ...80- Last file modified: ...8182### Unresolved83- Issue needing follow-up84```
Run npx skillmds@latest add berabuddies/session-watchdog in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Session Watchdog It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
berabuddies (@berabuddies) published this skill. Their other Agent Skills are listed on their SkillMD profile.