context-degradation
Fungsinya
Skill ini menjelaskan cara umum konteks AI bisa rusak, seperti informasi di tengah yang diabaikan atau detail salah yang menyebar. Skill ini untuk orang yang men-debug agent yang memburuk dalam sesi panjang.
Kapan dipakai
- βSaat jawaban agent memburuk semakin panjang percakapan berlangsung.
- βSaat agent mengabaikan detail yang Anda taruh di tengah input panjang.
- βSaat informasi yang bertentangan atau salah dalam konteks menghasilkan keluaran yang buruk.
Link skill
https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/blob/main/skills/context-degradation/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βAgent AI saya bingung setelah sesi panjang dan melewatkan hal-hal yang saya sampaikan sebelumnya. Bantu saya mencari tahu penyebabnya.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill menyebut lima pola, seperti lost in the middle dan poisoning serta clash, lengkap dengan tanda dan perbaikan untuk masing-masing, sehingga Anda bisa mencocokkan masalah dengan solusinya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Apa arti lost in the middle?
Model memberi perhatian lebih sedikit pada informasi yang diletakkan di tengah input panjang.
Bagaimana context poisoning berbeda?
Terjadi saat kesalahan masuk ke konteks dan terus dipakai ulang, sehingga jawaban selanjutnya makin buruk.
Di mana instruksi penting sebaiknya diletakkan?
Skill menyarankan meletakkan informasi kunci di dekat awal atau akhir, tempat perhatian paling kuat.
Detail
Deskripsi asli dari pembuat
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.
Popularitas
- Bintang GitHub
- 18k
- Peringkat
- #10638
- Lisensi
- MIT
- Diperbarui
- 11/10/2026
Komentar
- β¦
Skill lain dari repositori ini
context-engineering-collection
18kMembantu agent Anda mengelola apa yang masuk ke jendela konteks model AI, dari memori dan alat hingga sistem multi-agent dan evaluasi.
advanced-evaluation
18kMengajari agent Anda cara menilai jawaban AI memakai AI lain, dengan skor, perbandingan berpasangan, dan pemeriksaan bias.
bdi-mental-states
18kMengajari agent Anda memodelkan keyakinan, tujuan, dan rencana dengan pendekatan BDI, sehingga keputusannya bisa ditelusuri dan dijelaskan.
context-compression
18kMembantu agent Anda meringkas sesi AI yang panjang menjadi ringkasan yang tetap menyimpan keputusan, file, risiko, dan langkah berikutnya.
Skill serupa
add-model-provider
394kMemungkinkan agent Anda menghubungkan penyedia model AI baru ke OpenClaw dengan perintah pengaturan yang aman, menjaga kunci API tetap di luar teks biasa, dan menjalankan uji langsung.
acp-router
394kMembantu agent Anda mengirim tugas ke asisten pemrograman seperti Claude Code atau Cursor lewat OpenClaw, sehingga pekerjaan dijalankan di alat tersebut.
browser-automation
394kMengajari agent Anda mengendalikan halaman web langkah demi langkah, termasuk login, tab, dan pemulihan saat halaman berhenti merespons.