layers
Context Engineering
The discipline of managing what information an LLM sees, when it sees it, and how it is structured — from progressive disclosure and compression to retrieval, routing, and token budgeting
Co-Created by Kiran Shirol and Claude
Topics
Context Windows
RAG & Retrieval
Compression
Token Budgeting
Agent Skills
MCP & Tools
home
Learning Portal
play_arrow
Start Learning
summarize
Key Insights
dictionary
Glossary
8 chapters
· 3 sections
Section 1
Foundations — The Paradigm Shift
What context engineering is, why it replaced prompt engineering as the core AI skill, and the anatomy of a context window.
1
swap_horiz
What Is Context Engineering?
The paradigm shift from prompt engineering, championed by Andrej Karpathy and Shopify CEO Tobi Lütke in mid-2025. Why managing the full context window matters more than crafting prompts.
arrow_forward
Learn
2
view_column
The Context Window
Anatomy of an LLM context window — system prompts, user prompts, conversation history, RAG docs, tool schemas, few-shot examples, memory, and metadata. The “lost in the middle” problem.
arrow_forward
Learn
3
filter_list
Progressive Disclosure & Agent Skills
Loading information in tiers (discovery, activation, execution). Agent Skills as markdown files with YAML frontmatter. Anthropic’s Dec 2025 release adopted by OpenAI, Google, and Cursor.
arrow_forward
Learn
Section 2
Core Techniques — Compression, Routing & Retrieval
The three pillars of runtime context management: shrinking what stays, directing what enters, and fetching what’s needed.
4
compress
Context Compression
Sliding window + summarization hybrids. Keeping recent turns raw. Manus’s lessons on preserving tool call rhythm and error traces. Achieving 60–80% token cost reduction.
arrow_forward
Learn
5
route
Context Routing
LLM-based, rule-based, and hierarchical routing. Directing queries to the right context source before anything enters the window. Multi-domain agent optimization.
arrow_forward
Learn
6
manage_search
Retrieval Evolution (Agentic RAG)
From fixed RAG pipelines to agent-controlled retrieval loops. Graph RAG for relational reasoning. Self-RAG for self-critique. 42% faithfulness improvement over traditional RAG.
arrow_forward
Learn
Section 3
Production — Tools & Token Economics
Managing tool schemas at scale with MCP, optimizing KV-cache hit rates, and building token budgets for production systems.
7
build
Tool & Capability Management
MCP (Model Context Protocol) as the standard. Token cost of tool schemas (500+ tokens each). KV-cache invalidation from dynamic tool changes. Tool overlap and security surface.
arrow_forward
Learn
8
savings
Token Budgeting & Production Patterns
KV-cache optimization and hit rate as the key metric. Prompt caching for 90% cost savings. Token budget allocation strategies. Layering all context engineering patterns together.
arrow_forward
Learn
link
Related Courses
edit_note
Prompt Engineering
The predecessor discipline
search
RAG
Retrieval-Augmented Generation
hub
MCP
Model Context Protocol
precision_manufacturing
Harness Engineering
8 chapters · Agent systems