context-degradation

Diagnose context degradation and generate remediation recommendations for long-running agent systems.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/goodnight000/KittyCourt --skill context-degradation-goodnight000
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-degradation
Source: https://github.com/goodnight000/KittyCourt/tree/main/.codex/skills/Agent-Skills-for-Context-Engineering-main/skills/context-degradation
Command: npx skills add https://github.com/goodnight000/KittyCourt --skill context-degradation-goodnight000

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps engineers recognize when a long-running agent's context is growing unwieldy, diagnose degradation patterns such as lost-in-middle, context poisoning, distraction, and context clash, and provide actionable strategies to restore performance.

Core Features & Use Cases

  • Context degradation detection: measure attention distribution and identify degraded regions like lost-in-middle.
  • Poisoning and conflict detection: surface contradictions, hallucination markers, and error signals to support reliable reasoning.
  • Mitigation guidance: generate recommendations and recovery procedures to maintain stable and accurate agent behavior.
  • Real-world use case: during long chat sessions, run analysis to output a degradation score and concrete steps to improve response quality.

Quick Start

Use the context-degradation analyzer on the current session to obtain a health score, risk flags, and remediation recommendations.

Frequently Asked Questions about context-degradation

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

FAQPage Schema
How do I diagnose context degradation in long-running agent systems?

To diagnose context degradation, you can measure attention distribution to identify degraded regions such as lost-in-middle, then surface contradictions and hallucination markers to assess poisoning risks.

What is the lost-in-middle effect in long chat sessions?

The lost-in-middle effect is a context degradation pattern where an agent loses focus on information positioned in the middle of a long conversation, which you can detect by measuring attention distribution.

How do I detect context poisoning and conflicts during debugging sessions?

You detect context poisoning and conflicts by surfacing contradictions, hallucination markers, and error signals within the session, allowing you to assess poisoning risks and support reliable reasoning.

Can I analyze long conversation context using only numpy?

Yes, you can analyze long conversation context using numpy as the sole dependency to compute attention distribution metrics and generate a context health score with remediation recommendations.

What is the best way to mitigate context clash and distraction in agents?

The best way to mitigate context clash and distraction is to generate actionable recovery recommendations and remediation procedures that restore stable and accurate agent behavior.

When should I run a context health analysis on my agent?

You should run a context health analysis during long chat sessions or extended debugging operations to obtain a degradation score, risk flags, and concrete steps to improve response quality.