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가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
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.
인기도
- GitHub 스타
- 18k
- 순위
- #10638
- 라이선스
- MIT
- 업데이트
- 2026. 10. 11.
댓글
- …
이 저장소의 다른 스킬
context-engineering-collection
18k에이전트가 AI 모델의 컨텍스트 창에 들어가는 내용을 관리하도록 돕습니다. 메모리와 도구부터 다중 에이전트 구성, 평가까지 다룹니다.
advanced-evaluation
18k에이전트가 다른 AI를 이용해 AI 답변을 평가하는 방법을 가르칩니다. 점수 매기기, 나란히 비교, 편향 점검을 포함합니다.
bdi-mental-states
18k에이전트가 BDI 방식으로 믿음, 목표, 계획을 모델링하도록 가르쳐서, 결정을 추적하고 설명할 수 있게 합니다.
context-compression
18k에이전트가 긴 AI 세션을 결정, 파일, 위험, 다음 단계를 유지한 요약으로 줄이도록 돕습니다.
비슷한 스킬
add-model-provider
394k에이전트가 안전한 설정 명령으로 새 AI 모델 제공자를 OpenClaw에 연결하고, API 키를 평문으로 두지 않으며, 실시간 테스트를 실행하도록 돕습니다.
acp-router
394k에이전트가 OpenClaw를 통해 Claude Code나 Cursor 같은 코딩 도우미에 작업을 전달해, 작업이 그 도구에서 실행되도록 돕습니다.
browser-automation
394k에이전트가 로그인, 탭, 페이지 응답이 멈췄을 때의 복구를 포함해 웹 페이지를 단계별로 조작하도록 가르칩니다.