Agent skill · research science · aiskillstore
context-degradation
This skill should be used for diagnosing and mitigating context degradation: lost-in-middle failures, context poisoning, context clash, context confusion, attention-pattern issues, and agent performance degradation caused by accumulated or conflicting context.
Why this skill is useful
Provides specific patterns and mitigation strategies for diagnosing and addressing context degradation issues that the AI wouldn't reliably generate on its own.
What it needs
About 10k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
Context Degradation Patterns Diagnose and fix context failures before they cascade. Context degradation is not binary — it is a continuum that manifests through five distinct, predictable patterns: lost-in-middle, poisoning, distraction, confusion, and clash. Each pattern has specific detection signals and mitigation strategies. Treat degradation as an engineering problem with measurable thresholds, not an unpredictable failure mode. When to Activate Activate this skill when: Agent performance degrades unexpectedly during long conversations Debugging cases where agents produce incorrect or irrelevant outputs Designing systems that must handle large contexts reliably Evaluating context engineering choices for production systems Investigating "lost in middle" phenomena in agent outputs Analyzing context-related failures in agent behavior Do not activate this skill for adjacent work owned by other skills: Explaining foundational context mechanics without an active failure: context-fundamentals. Applying token-efficiency tactics after the failure pattern is known: context-optimization. Designing a compression or handoff summary strategy: context-compression. Persisting large outputs, logs, or scratch state outside the prompt: filesystem-context. Core Concepts Structure context placement around the attention U-curve: beginning and end positions receive reliable attention, while middle positions suffer materially reduced recall accuracy in long-context experiments (claim-context-degradation-lost-middle-ruler). This is not a model bug but a consequence of attention mechanics — the first token (often BOS) acts as an "attention sink" that absorbs disproportionate attention budget, leaving middle tokens under-attended as context grows. Treat context poisoning as a circuit breaker problem. Once a hallucination, tool error, or incorrect retrieved fact enters context, it compounds through repeated self-reference. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/context-degradation--69f1c5