context-degradation

Diagnose context degradation and attention distribution in LLM agent systems.

Updated Jun 29, 2026
One-click install
npx skills add https://github.com/wangyouan/codex-personal-kit --skill context-degradation-wangyouan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-degradation
Source: https://github.com/wangyouan/codex-personal-kit/tree/main/skills/context-degradation
Command: npx skills add https://github.com/wangyouan/codex-personal-kit --skill context-degradation-wangyouan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python, transformers, spacy, re, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill addresses context degradation in AI agents, helping to diagnose and mitigate issues such as lost-in-middle failures, context poisoning, and attention pattern problems.

Core Features & Use Cases

  • Context Degradation Detection: Identify and measure degradation patterns in LLM agent systems.
  • Attention Distribution Analysis: Analyze how attention varies across context positions.
  • Poisoning Detection: Detect potential context contamination and error propagation.
  • Use Case: For example, when an AI agent's performance degrades unexpectedly during a long conversation, this skill can be used to diagnose the cause and suggest mitigation strategies.

Quick Start

Run the degradation_detector script to analyze context degradation in an agent session.

Frequently Asked Questions about context-degradation

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

FAQPage Schema
What is context degradation in AI agents and how does it affect LLM performance?

Context degradation in AI agents refers to lost-in-middle failures, context poisoning, and attention pattern issues that cause unexpected performance drops during long conversations or complex decision-making processes.

How do I detect context poisoning and error propagation in LLM systems?

You can detect context poisoning and error propagation by running the degradation detector script to analyze context contamination and measure attention distribution across context positions in your agent session.

How do I analyze attention distribution to diagnose lost-in-middle failures?

Analyze attention distribution by applying the skill's text analysis and pattern recognition scripts to measure how attention varies across context positions, identifying degradation patterns in your LLM agent systems.

Do I need Python and Transformers to run context degradation analysis?

Yes, you need Python, the Transformers library, and spaCy installed to execute the text analysis and pattern recognition scripts required for diagnosing context degradation in AI agents.

Can I use this context degradation detection for long-form content generation?

Yes, context degradation detection applies to tasks requiring reliable context management in LLM systems, including long-form content generation and complex decision-making processes.

What are the limitations of using attention analysis for context degradation detection?

Attention analysis for context degradation detection relies on pattern recognition and text analysis via Python libraries, meaning its effectiveness depends on the quality of session logs and the specific attention patterns present.