context-degradation

Diagnose context degradation patterns and quantify attention collapse in long-running agent sessions.

Updated Feb 14, 2026
One-click install
npx skills add https://github.com/Shakudo-io/opencode-skills --skill context-degradation-shakudo-io
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-degradation
Source: https://github.com/Shakudo-io/opencode-skills/tree/main/context-optimization/skills/context-degradation
Command: npx skills add https://github.com/Shakudo-io/opencode-skills --skill context-degradation-shakudo-io

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Language models exhibit degradation patterns as context length grows, making it harder to retain critical mid-context information; this skill provides patterns and methods to recognize and mitigate those failures.

Core Features & Use Cases

  • Detects lost-in-middle attention patterns and quantifies their impact on important information.
  • Offers practical mitigation strategies such as context compaction, selective loading, and task isolation across sub-agents.
  • Applicable to long-running agent sessions, multi-turn dialogues, and large-context documents to improve reliability.

Quick Start

Run a context-health analysis on the current session to identify lost-in-middle patterns and generate actionable mitigation steps.

Frequently Asked Questions about context-degradation

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

FAQPage Schema
What is lost-in-middle context degradation in long-running agent sessions?

Lost-in-middle context degradation occurs when language models lose attention to critical mid-context information as conversations grow longer. This skill diagnoses that attention collapse and quantifies its impact on important information in multi-turn dialogues and large documents.

How do I detect attention collapse in long multi-turn conversations?

Detect attention collapse by running a context-health analysis to measure attention distribution and identify middle-region risk. This skill quantifies where attention collapses mid-context and generates a health score to reveal degradation patterns in long-running agent sessions.

Can I calculate a health score for context degradation using only numpy?

Yes, you can calculate a context health score using only numpy as a dependency. This skill measures attention distribution, detects poisoning indicators, and quantifies middle-region risk to generate health scores for long-running agent sessions without requiring additional frameworks.

What's the best way to prevent context confusion and clash patterns in large documents?

Prevent context confusion and clash patterns by using selective loading and task isolation across sub-agents. This skill identifies these degradation patterns in large-context documents and offers practical mitigation strategies like context compaction to retain critical mid-context information.

Does context degradation detection work for interactive assistants and large documents?

Yes, context degradation detection works for interactive assistants, multi-turn conversations, and large-context documents. The skill diagnoses lost-in-middle, poisoning, distraction, confusion, and clash patterns across these formats to improve long-running session reliability.