context-degradation

Detect and diagnose context degradation in agent sessions with health scoring.

Updated Jan 15, 2026
One-click install
npx skills add https://github.com/Razaib-khan/Hackathon-2-phases-2-3-4-5- --skill context-degradation-razaib-khan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-degradation
Source: https://github.com/Razaib-khan/Hackathon-2-phases-2-3-4-5-/tree/main/.claude/skills/context-degradation
Command: npx skills add https://github.com/Razaib-khan/Hackathon-2-phases-2-3-4-5- --skill context-degradation-razaib-khan

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps diagnose why long or complex agent sessions start producing worse outputs, so you can identify whether the issue is attention loss, conflicting context, irrelevant distractions, or poisoned state.

Core Features & Use Cases

  • Lost-in-middle analysis: Identifies when critical information is buried in low-attention regions of context.
  • Context health assessment: Evaluates utilization, degradation risk, and poisoning indicators to produce a health score and recommendations.
  • Recovery guidance: Suggests practical mitigation steps such as compaction, isolation, masking, and reordering critical information.
  • Use case: Use this Skill when an agent begins answering inconsistently after many tool calls, or when a long conversation causes the model to ignore earlier requirements.

Quick Start

Ask the skill to analyze a long agent context and recommend how to reduce degradation risk.

Frequently Asked Questions about context-degradation

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

FAQPage Schema
Why does my agent start producing worse outputs after many tool calls in a long conversation?

Agent performance drops in long sessions often stem from context degradation, where excessive tool outputs bury critical instructions in low-attention regions or introduce conflicting information. This Skill diagnoses these specific attention loss and distraction issues.

How do I diagnose lost-in-middle effects causing my agent to ignore earlier requirements?

To diagnose lost-in-middle effects, you analyze the agent's context window to identify when critical information is buried in low-attention regions. This Skill applies attention analysis to detect this drift and pinpoint why earlier requirements are ignored.

What is context poisoning in agent debugging and how is it detected?

Context poisoning occurs when conflicting or corrupted state information degrades agent responses. It is detected using poisoning heuristics and health scoring to evaluate degradation risk and identify specific clash or confusion scenarios within the session.

How can I fix context drift and recover agent performance in long workflows?

You can fix context drift by applying mitigation steps like context compaction, isolation, masking, and reordering critical information. This Skill generates practical recovery guidance and recommendations to restore performance in degraded agent sessions.

Can I use numpy to evaluate context health and utilization in agent sessions?

Yes, you can evaluate context health using numpy to process attention analysis and poisoning heuristics. This Skill leverages numpy to calculate utilization metrics and generate a comprehensive health score for agent debugging.

What is the best way to assess context health for long conversations and tool-heavy workflows?

The best way to assess context health is to evaluate utilization, degradation risk, and poisoning indicators together. This Skill analyzes these factors to produce a health score and targeted recommendations for mitigating context degradation.