context-canary

Detects silent context degradation in long agent sessions using a per-turn canary signal.

Updated May 26, 2026
One-click install
npx skills add https://github.com/KinalVR-Expo2026/KinalVR-Client --skill context-canary-kinalvr-expo2026
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-canary
Source: https://github.com/KinalVR-Expo2026/KinalVR-Client/tree/main/.claude/.agents/skills/context-canary
Command: npx skills add https://github.com/KinalVR-Expo2026/KinalVR-Client --skill context-canary-kinalvr-expo2026

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Context degradation in long AI sessions is silent and gradual: models stop attending to early instructions, and compaction summaries quietly drop standing instructions, with no visible error. This Skill installs a trivially checkable per-turn signal (a canary) so the moment context rot, drift, or compaction occurs, it becomes visible instead of corrupting work downstream. ## Core Features & Use Cases - Canary Contract Installation: Establishes a byte-stable first line on every response containing the user's name, a turn counter, and an honest self-check status (ctx ok / aging / thin). - Trip Detection & Calibration: Distinguishes a single missed canary (warning) from a confirmed trip (two consecutive misses, counter discontinuity, or agent self-declaration) to avoid false alarms. - Recovery Protocol: On a confirmed trip, checkpoints durable state to a file, re-anchors against project instructions, recommends a fresh session, and re-installs the canary with a new generation counter. - Use Case: At the start of a long refactoring session, ask the agent to install a context canary; if the name prefix or turn counter disappears after an auto-compaction event, you know immediately that earlier constraints may have been lost and can trigger the checkpoint-and-reset protocol. ## Quick Start Ask the agent to install a context canary for this session so every reply starts with your name and a turn counter.

Frequently Asked Questions about context-canary

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect context loss in long AI agent sessions?

Install a context canary: a standing instruction like starting every reply with your name and a turn counter. Because compliance costs almost nothing, its disappearance is strong evidence that early instructions fell out of effective context.

What is a context canary for LLM conversations?

A context canary is a trivially checkable standing instruction whose only job is to fail visibly, like a coal-mine canary. It converts silent, gradual context degradation into a binary per-turn check a human can verify at a glance.

How do I detect when conversation compaction dropped instructions?

Use a turn counter in the canary line. Compaction summaries rarely preserve exact counts, so a counter reset, skip, or vague value reveals the summarization boundary even when the name instruction itself survives.

What should I do when the AI loses context mid-session?

Follow the trip protocol: stop trusting drifted state, write a checkpoint file with goals, decisions, and next steps, re-read the project instructions, then start a fresh session seeded with the checkpoint rather than continuing on degraded context.

Does a working canary guarantee the context is healthy?

No. The test is one-sided: a missing canary is strong evidence of degradation, but a present canary is only weak evidence of health, since cheap stylistic habits can survive while harder constraints quietly rot.

Should I put the canary in CLAUDE.md or agent memory files?

Only if you want the habit across all sessions. A file-based canary survives compaction by design, so it no longer measures conversation context degradation; the session-only canary is the one that detects drift and compaction.