context-degradation

Diagnose and mitigate context degradation patterns in long-context language model workflows.

Updated Mar 22, 2026
One-click install
npx skills add https://github.com/TECH-HY/SKILLS --skill context-degradation-tech-hy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-degradation
Source: https://github.com/TECH-HY/SKILLS/tree/main/skills/context-degradation
Command: npx skills add https://github.com/TECH-HY/SKILLS --skill context-degradation-tech-hy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Language models degrade predictably as context grows, causing agents to lose information, repeat errors, or produce irrelevant outputs. This Skill helps you recognize, diagnose, and mitigate these failure patterns before they derail production systems. ## Core Features & Use Cases - Pattern Recognition: Identify five distinct degradation modes including lost-in-middle, context poisoning, distraction, confusion, and clash. - Empirical Benchmarks: Reference model-specific degradation thresholds and RULER benchmark findings to inform context budget decisions. - Mitigation Strategies: Apply the four-bucket approach (write, select, compress, isolate) and architectural patterns like compaction, masking, and sub-agent isolation. - Use Case: When an agent's output quality drops during a long session, use this Skill to determine whether context poisoning or distraction is the cause and apply the appropriate recovery strategy. ## Quick Start Ask the agent to diagnose why my agent's responses degraded after 60,000 tokens of conversation and suggest mitigation strategies.

Frequently Asked Questions about context-degradation

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

FAQPage Schema
How do I fix lost-in-middle problems in long contexts?

Place critical information at the beginning or end of context where attention is strongest, since models show U-shaped attention curves with 10-40% lower recall for middle content. Use explicit section headers and summary structures to surface key information at attention-favored positions.

What is context poisoning and how do I detect it?

Context poisoning occurs when errors or hallucinations enter context and compound through repeated reference. Detect it through degraded output on previously successful tasks, tool misalignment, and persistent hallucinations; recover by truncating context before the poisoning point or restarting with verified information.

At what context length do models start degrading?

Degradation onset varies by model: GPT-5.2 around 64K tokens, Claude Opus 4.5 around 100K, and Gemini 3 Pro around 500K. Many models show meaningful degradation at 8,000-16,000 tokens despite advertising much larger context windows.

Does a larger context window always improve agent performance?

No. Larger contexts can hurt performance through distraction, where even a single irrelevant document reduces accuracy, and through exponentially growing processing costs. Careful curation, relevance filtering, and compaction often outperform simply expanding context.

How do I prevent context clash from contradictory sources?

Context clash arises when multiple correct but contradictory pieces of information accumulate. Resolve it with explicit conflict marking that requests clarification, priority rules establishing source precedence, and version filtering that excludes outdated information from context.