Context engineering
Managing what the model sees: grounding, memory, budgets, project files, compaction and caching.
11 skills · 4 stages each
Skills
- What context isFor bothStart hereEverything the model sees in a turn: instructions, files, history, memory and tool results, and why it decides the answer110 questions
- Grounding in your own materialFor everyoneAttaching documents and data so answers come from them, with quotes that point back and an honest 'not in the source'needs: What context is110 questions
- Projects, memory and notebooksFor everyonePersistent context in Claude and ChatGPT Projects, Gems, assistant memory and source-bound notebooks, and keeping it accurateneeds: What context is110 questions
- Context budget and context rotFor bothWhy more context can hurt, and how to trim, order and summarize what goes into the windowneeds: What context is110 questions
- Project memory filesFor engineersCLAUDE.md, AGENTS.md, GEMINI.md and rules files: what an agent loads every session and how to keep it lean and trueneeds: Projects, memory and notebooks110 questions
- Just-in-time retrievalFor engineersLetting the agent look things up when it needs them instead of pre-loading everythingneeds: Context budget and context rot110 questions
- Compaction and handoffsFor bothSummaries, progress notes and fresh sessions that keep long work on track across a full windowneeds: Context budget and context rot110 questions
- Prompt cachingFor engineersOrdering prompts so the stable part is cached, cutting cost and latency, and keeping the cache from silently breakingneeds: What context is110 questions
- Context poisoning, clash and confusionFor bothHow wrong, contradictory, irrelevant or untrusted material in the window misleads answers, and how to recoverneeds: Context budget and context rot110 questions
- Working with long documents and filesFor everyoneWhat assistants actually read from big PDFs, spreadsheets and scans, and how to get full, checked coverageneeds: Grounding in your own material110 questions
- Tools and MCP servers in the context windowFor engineersTool definitions and tool results use the window too; too many tools hurt selection, cost and accuracyneeds: Context budget and context rot110 questions
Scenarios using this domain
Where to study
- Prompt caching (Claude docs) (opens in a new tab)DocsFree
Breakpoints, cache lifetimes, what invalidates the cache and the usage fields that report reads and writes.
- Prompt caching (OpenAI API docs) (opens in a new tab)DocsFree
How automatic prefix caching works on OpenAI models, the cache key and the cached-token usage field.
- Context caching (Gemini API docs) (opens in a new tab)DocsFree
Implicit and explicit caching on Gemini, with storage-time and token-count details.
- Claude API pricing (opens in a new tab)DocsFree
The price table with base input, cache write and cache read rates per model, for cost arithmetic.
- Context engineering for AI agents: lessons from building Manus (opens in a new tab)ArticleFree
A production team explains why a stable prefix and append-only context matter in agent loops.
- How long contexts fail (Drew Breunig) (opens in a new tab)ArticleFree
Names poisoning, distraction, confusion and clash, with examples from real agents.
- How to fix your context (Drew Breunig) (opens in a new tab)ArticleFree
Practical ways to prune, quarantine and summarise context after a failure.
- The lethal trifecta for AI agents (Simon Willison) (opens in a new tab)ArticleFree
Plain explanation of when untrusted content in context can leak private data.
- LLM01: Prompt Injection (OWASP) (opens in a new tab)StandardFree
The security community's definition of prompt injection and its mitigations.
- Effective context engineering for AI agents (Anthropic) (opens in a new tab)ArticleFree
Anthropic's guidance on keeping only the most useful information in the window.
- Lost in the Middle: How Language Models Use Long Contexts (opens in a new tab)PaperFree
Research on how models use information placed in different parts of a long input.
- What are projects? (Claude Help Center) (opens in a new tab)DocsFree
How a Claude project keeps a knowledge base and custom instructions for every chat inside it.