context-engineering-fundamentals

Featured

Manages attention and evidence in long agent sessions. Use for lost instructions, dropped evidence, or large multi-agent contexts.

Data & Documents 366 stars 63 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 89/100

Stars 20%
85
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Context engineering fundamentals Context engineering is the practice of managing an LLM's limited attention budget. Use this skill to keep instructions, evidence, and state available during long work. ## Core concept **Context windows are constrained by attention mechanics, not only token capacity.** A large context limit does not guarantee equal use of every item. ## The lost-in-middle effect The "Lost in the Middle" experiments show that retrieval quality can change with information position. The result depends on the model, task, context length, and number of documents. | Position | Common test result | |----------|--------------------| | Beginning | Often easier to retrieve | | Middle | Can be harder to retrieve | | End | Often benefits from recency | **Implication:** Keep critical constraints easy to find and repeat them near the decision that uses them. Do not assume position alone predicts recall. ## Context degradation patterns ### 1. Lost-in-middle Information in the middle of long context gets lower attention weight. **Mitigation:** Structure with explicit sections. Put critical constraints at start AND end. ### 2. Context poisoning Errors compound when incorrect information enters context (from tool outputs, summaries, or earlier mistakes). **Mitigation:** Validate intermediate outputs. Don't blindly trust previous responses. ### 3. Context distraction Irrelevant information forces attention allocation away from relevant content. Models can't "skip" ...

Details

Author
jamditis
Repository
jamditis/claude-skills-journalism
Created
7 months ago
Last Updated
yesterday
Language
Python
License
MIT

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

context-engineering

Use when managing what an LLM sees. Covers context-window budgeting, retrieval and compaction, memory across turns, tool-result pruning, and the failure modes that come from too much context rather than too little.

25 Updated 2 days ago
nimadorostkar
AI & Automation Listed

context-fundamentals

Explain or reason about foundational context engineering concepts: what context is, the anatomy of a context window, attention mechanics, the U-shaped attention curve, why context quality matters more than quantity, and the mental models needed to interpret context-engineering decisions. Use for conceptual explanation, onboarding, and background reading. Route operational work to context-degradation for attention failures and context-optimization for token-efficiency work.

33 Updated 3 days ago
shipshitdev
AI & Automation Listed

context-engineering

Engineer what goes into the LLM context window — system prompts, retrieved docs, tool schemas, conversation history, memory, examples. Apply the four operations write/select/compress/isolate to manage context as a finite resource. Enforce the 40% rule on context utilization. Use whenever the user is designing system prompts, debugging quality degradation in long conversations, hitting context limits, managing per-step retrieval, dealing with sub-agent context isolation, or asking about "context engineering" / "prompt engineering" / CLAUDE.md / AGENTS.md / instruction files.

14 Updated 1 weeks ago
Moai-Team-LLC