본문으로 건너뛰기
Skillpedia
에이전트18k · #10638

context-degradation

하는 일

이 스킬은 AI의 컨텍스트가 잘못되는 흔한 방식을 설명합니다. 예를 들면 중간에 있는 정보가 무시되거나, 잘못된 세부 내용이 퍼지는 것입니다. 긴 세션에서 점점 나빠지는 에이전트를 디버깅하는 사람을 위한 스킬입니다.

사용하는 경우

  • ✓대화가 길어질수록 에이전트의 답변이 나빠질 때.
  • ✓에이전트가 긴 입력의 중간에 놓인 세부 내용을 무시할 때.
  • ✓맥락 속 상충하거나 잘못된 정보가 나쁜 결과를 낳을 때.

스킬 링크

https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/blob/main/skills/context-degradation/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/blob/main/skills/context-degradation/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 AI 에이전트가 긴 세션 후에 헷갈려서 제가 앞서 말한 내용을 놓칩니다. 왜 그런지 찾아 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

스킬은 다섯 가지 패턴, 예를 들어 중간 정보 상실, 오염, 충돌을 제시하고 각각의 신호와 해결책을 줍니다. 그래서 문제를 해결책과 맞춰 볼 수 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Context Degradation Patterns

Diagnose and fix context failures before they cascade. Context degradation is not binary — it is a continuum that manifests through five distinct, predictable patterns: lost-in-middle, poisoning, distraction, confusion, and clash. Each pattern has specific detection signals and mitigation strategies. Treat degradation as an engineering problem with measurable thresholds, not an unpredictable failure mode.

When to Activate

Activate this skill when:

  • Agent performance degrades unexpectedly during long conversations
  • Debugging cases where agents produce incorrect or irrelevant outputs
  • Designing systems that must handle large contexts reliably
  • Evaluating context engineering choices for production systems
  • Investigating "lost in middle" phenomena in agent outputs
  • Analyzing context-related failures in agent behavior

Do not activate this skill for adjacent work owned by other skills:

  • Explaining foundational context mechanics without an active failure: context-fundamentals.
  • Applying token-efficiency tactics after the failure pattern is known: context-optimization.
  • Designing a compression or handoff summary strategy: context-compression.
  • Persisting large outputs, logs, or scratch state outside the prompt: filesystem-context.

Core Concepts

Structure context placement around the attention U-curve: beginning and end positions receive reliable attention, while middle positions suffer materially reduced recall accuracy in long-context experiments (claim-context-degradation-lost-middle-ruler). This is not a model bug but a consequence of attention mechanics — the first token (often BOS) acts as an "attention sink" that absorbs disproportionate attention budget, leaving middle tokens under-attended as context grows.

Treat context poisoning as a circuit breaker problem. Once a hallucination, tool error, or incorrect retrieved fact enters context, it compounds through repeated self-reference. A poisoned goals section causes every downstream decision to reinforce incorrect assumptions. Detection requires tracking claim provenance; recovery requires truncating to before the poisoning point or restarting with verified-only context.

Filter aggressively before loading context — even a single irrelevant document measurably degrades performance on relevant tasks. Models cannot "skip" irrelevant context; they must attend to everything provided, creating attention competition between relevant and irrelevant content. Move information that might be needed but is not immediately relevant behind tool calls instead of pre-loading it.

Isolate task contexts to prevent confusion. When context contains multiple task types or switches between objectives, models incorporate constraints from the wrong task, call tools appropriate for a different context, or blend requirements from multiple sources. Explicit task segmentation with separate context windows eliminates cross-contamination.

Resolve context clash through priority rules, not accumulation. When multiple correct-but-contradictory sources appear in context (version conflicts, perspective conflicts, multi-source retrieval), models cannot determine which applies. Mark contradictions explicitly, establish source precedence, and filter outdated versions before they enter context.

Detailed Topics

Lost-in-Middle: Detection and Placement Strategy

Place critical information at the beginning and end of context, never in the middle. The U-shaped attention curve means middle-positioned information suffers 10-40% reduced recall accuracy. For contexts over 4K tokens, this effect becomes significant.

Use summary structures that surface key findings at attention-favored positions. Add explicit section headers and structural markers — these help models navigate long contexts by creating attention anchors. When a document must be included in full, prepend a summary of its key points and append the critical conclusions.

Monitor for lost-in-middle symptoms: correct information exists in context but the model ignores it, responses contradict provided data, or the model "forgets" instructions given earlier in a long prompt.

Context Poisoning: Prevention and Recovery

Validate all external inputs before they enter context. Tool outputs, retrieved documents, and model-generated summaries are the three primary poisoning vectors. Each introduces unverified claims that subsequent reasoning treats as ground truth.

Detect poisoning throu

자주 묻는 질문

중간에서 잃어버린다는 것은 무슨 뜻인가요?

모델이 긴 입력의 가운데 놓인 정보에 주의를 덜 기울인다는 뜻입니다.

맥락 오염은 어떻게 다른가요?

맥락에 들어간 오류가 계속 재사용되면서, 이후 답변을 점점 나쁘게 만드는 경우입니다.

핵심 지시는 어디에 두어야 하나요?

스킬은 주의가 가장 강한 입력의 앞부분이나 끝부분 가까이에 핵심 정보를 두라고 제안합니다.

상세 정보

작성자의 원본 설명

This skill should be used for diagnosing and mitigating context degradation: lost-in-middle failures, context poisoning, context clash, context confusion, attention-pattern issues, and agent performance degradation caused by accumulated or conflicting context.

repo: muratcankoylan/Agent-Skills-for-Context-Engineering

인기도

GitHub 스타
18k
순위
#10638
라이선스
MIT
업데이트
2026. 10. 11.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬