#context-engineering
21 articles
Code Mode: why agents write code instead of calling tools
Why agents that write code against tool APIs beat JSON tool calling: the 150K-to-2K token math, a worked before/after, and when direct calls still win.
Agent Skills: packaging expertise as files, not code
How Agent Skills use progressive disclosure to load expertise on demand — the SKILL.md format, real token math, and when to pick skills over MCP.
How AI coding assistants work
The engineering behind Copilot, Cursor, and Claude Code: repo maps, tree-sitter indexing, edit formats, long-file strategies, and how to evaluate code generation properly.
Long Context vs RAG: The Million-Token Question
When does stuffing a million tokens beat retrieval? The empirics on lost-in-the-middle accuracy, context-stuffing costs, and when RAG still wins at 1M tokens.
Agent Memory Architectures: Episodic, Semantic, Procedural
How production agents store and recall knowledge across sessions — episodic logs, semantic stores, procedural caches, and sane forgetting policies.
Agentic RAG: When Retrieval Becomes a Reasoning Loop
Agentic RAG swaps single-shot retrieval for a decision loop — retrieve, judge, rewrite, repeat. The patterns, failure modes, and when it pays off.
Prompt Anti-Patterns: The Failure Modes That Ship to Production Silently
Ten documented prompt defects — instruction-stacking, few-shot pollution, persona-stuffing — and why they survive code review and only surface under production load.
Reasoning models plus tools: agentic workflows and function calling
How o3, o4-mini, and Claude extended thinking combine reasoning with tool calls to make harder agent tasks tractable — and the failure modes they introduce.
Context window management for agents: select, compress, isolate
How to keep agents from degrading when the context fills up — retrieval-based selection, compression strategies, multi-agent isolation, and the numbers behind each choice.
Context Windows, KV Cache, and the Reality Behind 1M Token Claims
What context windows actually cost in GPU memory, why effective recall degrades before the advertised limit, and how to make smart architectural choices about long context.
Prompt Caching: Cutting Costs 50-90% Without Changing Model Behavior
How Anthropic and OpenAI prompt caching works, what breaks the cache, and how to structure prompts to hit 80%+ cache rates in production.
Agent Memory: From Context Window to Persistent Knowledge
How agents remember things across tool calls, sessions, and deployments — in-context working memory, episodic stores, semantic vector DBs, and when each breaks.
Few-shot prompting, chain-of-thought, and reasoning models
Master few-shot prompting and chain-of-thought, then learn why both techniques must be rethought entirely for o3, Claude extended thinking, and Gemini 2.x.
Prompt caching deep dive: prefix caching, semantic caching, and when each wins
How provider-side prefix caching and application-side semantic caching work, what they cost, where each breaks, and the decision framework for combining them in production.
Prompting reasoning models: what changes and what breaks
The counter-intuitive rules for prompting o3, DeepSeek-R1, and Claude extended thinking — simpler prompts often outperform elaborate ones, and common techniques backfire.
System Prompts: Design Patterns That Actually Hold Up in Production
Four-section structure, cache-friendly ordering, modular composition, and how to write system prompts that survive model upgrades and adversarial users.
RAG from Scratch: Ingestion, Retrieval, and Generation in One Pass
Build a working RAG pipeline end-to-end — parse, chunk, embed, index, retrieve, and generate — understanding every decision before layering on complexity.
From Prompt Engineering to Context Engineering: What Actually Changed
Why writing clever prompts is the wrong mental model for 2025 LLM systems, and how the context-window-as-RAM framing changes what you build.
Tokens, Costs, and the Context Window
Why text becomes tokens, how input/output pricing asymmetry drives your bill, what the context window actually limits, and how prompt caching cuts costs by up to 90%.
Context Engineering: Filling the Window Right
The shift from prompt to context engineering: how to write, select, compress, and isolate what goes in the window — and the silent failure modes that ship to production.
RAG in One Pass: Build, Measure, Improve
Build a complete RAG pipeline end-to-end — ingest, chunk, embed, index, retrieve, generate — with evaluation wired in from day one so you catch failures before users do.