Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when working on complex multi-step tasks, when a session is getting long (40+ tool calls), when the agent starts ignoring rules it followed earlier, when conventions drift, when output quality seems to degrade, or after any context compaction event. Prevents long-session corruption AND context compaction amnesia through behavioral self-enforcement.
.claude/skills/wshobson-session-guard/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 132% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 30% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 66% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 88% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 75% | 0% |
Long sessions corrupt silently. Context compaction drops instructions unannounced. Hooks don't fix it (confirmed by multiple developers on GitHub issues #19471, #9796, #64171). This skill prevents both through behavioral self-enforcement: monitor health, anchor critical rules through compaction, split before damage occurs. No packages, no databases - pure behavioral enforcement that works in every harness.
| Signal | Threshold | Action | |--------|-----------|--------| | Tool call count | >40 | YELLOW: checkpoint + recite critical rules | | Tool call count | >60 | RED: split or compact with anchor | | Agent contradicts earlier decision | Any | VERIFY: re-read source of truth | | Style/naming drift | Any | RECITE: state the active rules aloud | | File read returns unexpected content | Any | RE-READ: don't trust cached state | | Task scope growing unbounded | Continuous | SPLIT: one task per session |
Normal operation. No intervention needed.
When compaction has occurred (sudden loss of earlier context, or after /compact):
Keep critical instructions in FILES (CLAUDE.md, CONTEXT.md), NOT in conversation. If a rule matters, it must live in a file the agent can re-read - not in something agreed on earlier.
Context compaction is the #1 unsolved platform problem in 2026. Hooks don't fix it (confirmed: the agent ignores post-compaction injections because the compaction summary creates narrative momentum). This skill is the lightweight behavioral countermeasure: no infrastructure, no packages - disciplined self-monitoring that works in every harness.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 2,785 | 2,963 | +6% | 1 | 1 | 0% | 396 | 1,098 | +177% | 0 | 0 | — |
case-02 | fail→pass | 4,562 | 5,102 | +12% | 1 | 1 | 0% | 746 | 1,731 | +132% | 0 | 0 | — |
case-03 | fail→fail | 5,620 | 4,234 | -25% | 1 | 1 | 0% | 804 | 1,576 | +96% | 0 | 0 | — |
case-04 | pass→pass | 5,932 | 4,866 | -18% | 1 | 1 | 0% | 950 | 1,662 | +75% | 0 | 0 | — |
case-05 | fail→fail | 6,976 | 4,017 | -42% | 1 | 1 | 0% | 1,119 | 1,657 | +48% | 0 | 0 | — |
case-06 | fail→fail | 7,065 | 3,808 | -46% | 1 | 1 | 0% | 1,171 | 1,474 | +26% | 0 | 0 | — |
case-07 | pass→pass | 6,946 | 3,586 | -48% | 1 | 1 | 0% | 1,160 | 1,474 | +27% | 0 | 0 | — |
case-08 | pass→pass | 11,335 | 8,005 | -29% | 1 | 1 | 0% | 1,704 | 2,159 | +27% | 0 | 0 | — |
case-09 | pass→pass | 4,944 | 2,886 | -42% | 1 | 1 | 0% | 672 | 1,276 | +90% | 0 | 0 | — |
case-10 | pass→pass | 11,731 | 3,608 | -69% | 1 | 1 | 0% | 2,024 | 1,390 | -31% | 0 | 0 | — |
case-11 | pass→pass | 4,917 | 3,735 | -24% | 1 | 1 | 0% | 679 | 1,515 | +123% | 0 | 0 | — |
case-12 | pass→pass | 11,765 | 2,283 | -81% | 1 | 1 | 0% | 1,983 | 1,117 | -44% | 0 | 0 | — |
case-13 | fail→pass | 6,771 | 4,251 | -37% | 1 | 1 | 0% | 1,162 | 1,509 | +30% | 0 | 0 | — |
case-14 | pass→pass | 15,955 | 7,281 | -54% | 1 | 1 | 0% | 1,927 | 2,005 | +4% | 0 | 0 | — |
case-15 | pass→pass | 6,297 | 2,965 | -53% | 1 | 1 | 0% | 977 | 1,395 | +43% | 0 | 0 | — |
case-16 | fail→pass | 6,269 | 4,536 | -28% | 1 | 1 | 0% | 981 | 1,632 | +66% | 0 | 0 | — |
case-17 | fail→fail | 5,807 | 1,699 | -71% | 1 | 1 | 0% | 924 | 1,078 | +17% | 0 | 0 | — |
case-18 | fail→pass | 5,655 | 4,530 | -20% | 1 | 1 | 0% | 850 | 1,595 | +88% | 0 | 0 | — |
case-19 | pass→pass | 3,435 | 5,323 | +55% | 1 | 1 | 0% | 496 | 1,840 | +271% | 0 | 0 | — |
case-20 | pass→pass | 12,192 | 7,973 | -35% | 1 | 1 | 0% | 2,085 | 2,335 | +12% | 0 | 0 | — |
case-21 | pass→pass | 3,664 | 3,450 | -6% | 1 | 1 | 0% | 648 | 1,485 | +129% | 0 | 0 | — |
case-22 | pass→pass | 1,822 | 1,324 | -27% | 1 | 1 | 0% | 289 | 1,021 | +253% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +18 percentage points is the difference between those two pass rates over the 21 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.