$npx -y skills add berabuddies/Semia --skill session-watchdogMonitor session context levels and proactively save checkpoints before compaction. Use when: (1) session context exceeds 80% capacity, (2) user asks about session status or memory, (3) at the start of each new session to check context, or (4) before long tasks that might push con
| 1 | # Session Watchdog |
| 2 | |
| 3 | Monitors context levels, warns before compaction, and saves checkpoints to preserve important information. |
| 4 | |
| 5 | ## Context Thresholds |
| 6 | |
| 7 | | Level | Tokens | Action | |
| 8 | |-------|--------|--------| |
| 9 | | Safe | 0-140k | Normal operation | |
| 10 | | **Warning** | 140k-160k | Warn user, save checkpoint | |
| 11 | | Critical | 160k-197k | Warn + stop unless urgent | |
| 12 | | Full | 197k+ | Compaction imminent | |
| 13 | |
| 14 | ## Check Context |
| 15 | |
| 16 | Before each session and periodically during long conversations: |
| 17 | |
| 18 | ``` |
| 19 | session_status |
| 20 | ``` |
| 21 | |
| 22 | Check the `contextTokens` field from the response. |
| 23 | |
| 24 | ## Checkpoint Protocol |
| 25 | |
| 26 | When approaching 80% (160k tokens): |
| 27 | |
| 28 | 1. **Save checkpoint to memory file:** |
| 29 | - Read current memory/YYYY-MM-DD.md |
| 30 | - Add key context: decisions, pending tasks, important details |
| 31 | - Write back to memory file |
| 32 | |
| 33 | 2. **Alert user:** |
| 34 | Say: "⚠️ Approaching context limit (~160k tokens). Saving checkpoint to memory before continuing." |
| 35 | |
| 36 | 3. **Ask user:** |
| 37 | - Continue and accept compaction? |
| 38 | - Summarize and restart fresh? |
| 39 | - Pause until ready? |
| 40 | |
| 41 | ## What to Save |
| 42 | |
| 43 | Essential information that must survive compaction: |
| 44 | |
| 45 | - **Decisions made** in this conversation |
| 46 | - **Pending tasks** not yet completed |
| 47 | - **Important context** (project state, configurations, preferences) |
| 48 | - **Files modified** and their paths |
| 49 | - **Unresolved issues** requiring follow-up |
| 50 | |
| 51 | ## When to Trigger |
| 52 | |
| 53 | - At session start |
| 54 | - After every 30k tokens of conversation |
| 55 | - Before initiating large tasks (file edits, multiple operations) |
| 56 | - When user asks "how much context do we have left?" |
| 57 | |
| 58 | ## Memory File Format |
| 59 | |
| 60 | ``` |
| 61 | # YYYY-MM-DD |
| 62 | |
| 63 | ## Session Checkpoint (at X% context) |
| 64 | |
| 65 | ### Decisions |
| 66 | - Decision 1 |
| 67 | - Decision 2 |
| 68 | |
| 69 | ### Pending |
| 70 | - [ ] Task 1 |
| 71 | - [ ] Task 2 |
| 72 | |
| 73 | ### Important Context |
| 74 | - Project state: ... |
| 75 | - Last file modified: ... |
| 76 | |
| 77 | ### Unresolved |
| 78 | - Issue needing follow-up |
| 79 | ``` |