context-degradation

Diagnose context degradation in AI agents and provide remediation recommendations.

Updated Apr 15, 2025
One-click install
npx skills add https://github.com/khrore/nix-config --skill context-degradation-khrore
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-degradation
Source: https://github.com/khrore/nix-config/tree/main/dotfiles/common/.config/opencode/skills/context-degradation
Command: npx skills add https://github.com/khrore/nix-config --skill context-degradation-khrore

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Diagnose and mitigate context degradation in AI agents, helping maintain reliable performance across long conversations and complex task flows.

Core Features & Use Cases

  • Lost-in-middle detection and attention distribution analysis to surface degraded information regions.
  • Context poisoning and contradiction detection with risk scoring and remediation guidance.
  • Context health scoring with actionable recommendations and recovery strategies for long-running sessions.

Quick Start

Analyze a running agent context to surface degradation risks and provide practical remediation steps.

Frequently Asked Questions about context-degradation

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

FAQPage Schema
How do I detect context degradation in long-running AI agents?

Detect context degradation in long-running AI agents by analyzing attention distribution and calculating context health scores to surface degraded information regions. The tool identifies patterns like lost-in-middle and context poisoning to provide actionable remediation.

What is lost-in-middle context degradation and how does it affect multi-agent systems?

Lost-in-middle context degradation occurs when AI agents fail to process information located in the middle of long contexts, degrading performance in multi-agent systems. It is diagnosed via attention analysis to surface regions where information is being ignored or forgotten.

How do I prevent context poisoning in multi-turn dialogs?

Prevent context poisoning in multi-turn dialogs by running contradiction detection and risk scoring on agent contexts. The tool identifies poisoned contexts and generates recovery strategies with actionable recommendations to maintain reliable conversation performance.

Can I use this context degradation diagnostic tool with only numpy installed?

Yes, you can use this context degradation diagnostic tool with only numpy installed, as it is the sole runtime dependency required. The tool provides scripts and references to analyze agent health and mitigate degradation risks in your environment.

What is the best way to score context health across complex multi-agent task flows?

The best way to score context health across complex multi-agent task flows is to apply detection patterns for context distraction, confusion, and clash. The tool outputs a health score alongside actionable recommendations for resilient context handling and recovery.

Why does my AI agent fail to maintain context in long conversations?

Your AI agent fails to maintain context in long conversations due to context degradation patterns such as distraction, confusion, or clash. Diagnose these specific failures using context health scoring and attention distribution analysis to apply targeted remediation steps.