context-degradation

Detect and diagnose context degradation patterns in long prompts for LLM agents.

1|1|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/corticalstack/claude-code-flow --skill context-degradation-corticalstack
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-degradation
Source: https://github.com/corticalstack/claude-code-flow/tree/main/.claude/skills/context-degradation
Command: npx skills add https://github.com/corticalstack/claude-code-flow --skill context-degradation-corticalstack

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

It helps you recognize and mitigate when an agent’s performance degrades because important instructions or facts get lost, corrupted, or overridden inside a growing prompt.

Core Features & Use Cases

  • Detect degradation patterns: Identifies lost-in-the-middle risk, context poisoning indicators, structural middle-zone risk, and signs of confusion/clash.
  • Recommend mitigations: Guides repositioning critical facts, truncating poisoned segments, and applying selective loading, compression, or isolation.
  • Use cases: Debugging agent failures in long conversations, improving RAG quality under large contexts, designing robust context windows, and setting operational thresholds for monitoring.

Quick Start

Use the context-degradation skill to diagnose why an agent suddenly started ignoring earlier instructions after the prompt became very long.

Frequently Asked Questions about context-degradation

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

FAQPage Schema
Why does my LLM agent ignore earlier instructions in long conversations?

Agents ignore instructions due to context degradation patterns like lost-in-the-middle risk or context poisoning. This skill diagnoses these failures by evaluating attention placement and recommending mitigations such as repositioning critical facts or truncating poisoned segments.

How do I detect context poisoning in RAG context assembly?

Detect context poisoning by running composite health analysis to identify corrupted or overridden information segments. This skill evaluates structural middle-zone risk and guides selective loading, compression, or isolation to mitigate poisoned context windows.

What is lost-in-the-middle risk in long-context LLM monitoring?

Lost-in-the-middle risk occurs when LLMs fail to process information placed in the center of long prompts. This skill identifies this attention failure during production monitoring and recommends actionable mitigations like selection, compression, or recovery via truncation.

How do I debug an agent that fails after tool-output-heavy runs?

Debug tool-output-heavy agent failures by diagnosing context degradation patterns like distraction, confusion, and clash. This skill evaluates attention placement risk across growing prompts and produces actionable mitigation recommendations for context isolation.

Can I use this for setting operational thresholds in production LLM monitoring?

Yes, this skill supports production monitoring to set operational thresholds. It detects attention, poisoning, distraction, confusion, and clash degradation patterns, evaluating composite health to guide recovery via truncation and structural isolation.

What are the limitations when diagnosing context window confusion and clash?

Diagnosing confusion and clash requires evaluating composite health and attention placement risk across long prompts. Limitations arise when prompts lack identifiable structural middle-zones, making selective loading and isolation mitigations less effective for recovery.