context-degradation

Diagnose and mitigate context degradation patterns in LLM agent systems.

Updated May 18, 2026
One-click install
npx skills add https://github.com/fts-pro/FTS-MMIS-AFRIKA --skill context-degradation-fts-pro
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: context-degradation
Source: https://github.com/fts-pro/FTS-MMIS-AFRIKA/tree/main/.agent/skills/context-degradation
Command: npx skills add https://github.com/fts-pro/FTS-MMIS-AFRIKA --skill context-degradation-fts-pro

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Long-running LLM agents silently degrade as context grows: critical instructions get lost in the middle of the window, hallucinated facts poison downstream reasoning, irrelevant documents dilute attention, and contradictory sources cause unpredictable outputs. This Skill provides detection signals, thresholds, and mitigation strategies for these five failure patterns. ## Core Features & Use Cases - Pattern Diagnosis: Identify lost-in-middle, poisoning, distraction, confusion, and clash failures using concrete detection signals and empirical benchmarks. - Health Analysis Scripts: Run the included Python detector to measure attention distribution, flag at-risk critical content, detect poisoning indicators, and compute a composite context health score. - Mitigation Framework: Apply the Write/Select/Compress/Isolate strategies with placement rules, compaction triggers, and recovery procedures for poisoned context. - Use Case: An agent that worked well for 10 turns starts ignoring instructions at turn 30. Use this Skill to check context utilization, detect whether key constraints sit in the degraded middle region, and trigger compaction before the performance cliff. ## Quick Start Ask the agent to analyze the current conversation context for degradation symptoms and recommend mitigation steps using the context-degradation skill.

Frequently Asked Questions about context-degradation

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

FAQPage Schema
How do I detect lost-in-middle problems in LLM context?▼

Detect lost-in-middle issues by mapping attention distribution across context positions and checking whether critical information falls in the degraded middle region. The included degradation_detector.py script flags at-risk positions and recommends moving key content to the beginning or end of context.

What is context poisoning and how do I fix it?▼

Context poisoning occurs when hallucinations, tool errors, or incorrect retrieved facts enter context and compound through self-reference. Fix it by truncating to before the poisoning point or restarting with verified-only context rather than layering corrections on top.

At what context length does LLM performance degrade?▼

Degradation typically begins at 60-70% of the advertised context window, with meaningful drops often starting at 8K-16K tokens for complex tasks. The decline is non-linear with a cliff edge, so set compaction triggers around 70% of the known onset threshold.

Why does my agent ignore instructions in long conversations?▼

Instructions placed in the middle of long contexts suffer 10-40% reduced recall due to the U-shaped attention curve. Before diagnosing degradation, verify the prompt works at low context lengths, since poor prompt structure produces identical symptoms.

Does a bigger context window solve degradation problems?▼

No. Larger windows delay but do not eliminate U-shaped degradation, and processing cost grows non-linearly with token count. For multi-task workloads, splitting tasks across sub-agents with isolated contexts is more effective than expanding a single context.