Key AI Concepts (3): Prompt Engineering / Context Engineering

Key AI Concepts (3): Prompt Engineering / Context Engineering#

A conductor arranging light into a musical score, with a stage set being assembled behind

This chapter covers prompt engineering, which is about “how to compose questions / instructions,” and context engineering, which is about “how to provide the material (background information) the model should consult when producing an answer.” Recall the context window from the previous chapter: prompt engineering is writing the “instructions” that go into it well, and context engineering is designing “everything” that goes into it.

I Was Collecting Token-Saving Tips, Then I Opened My Logs and Changed the Order

I Was Collecting Token-Saving Tips, Then I Opened My Logs and Changed the Order#

2026-10-25

On a wooden desk under a lamp, a small robot strains to push an endless paper scroll, a person’s hand examines the scroll through a magnifying glass, and a small folded note sits beside the robot

Plenty of tips, but where to start?#

Token consumption is one of the most common topics among people who use coding agents like Claude Code and Codex. As people hit their subscription limits early or see API bills grow beyond expectations, articles on how to save tokens keep piling up. I use both tools every day, so I went looking for these articles too.

I Dug Into Prompt Caching and Found That Hit Rate Isn't the Goal

I Dug Into Prompt Caching and Found That Hit Rate Isn’t the Goal#

2026-08-05

Prompt content stacked like geological strata by change frequency, with the lower layers reused from cache

It Started With “Where Does This Actually Happen?”#

I knew prompt caching reduced costs. My understanding went about as far as: when you send the same system prompt repeatedly, it gets cheaper from the second request onward.

But the more I thought about it, the stranger it seemed. If caching happens in some relay layer outside the model, then from the model’s point of view nothing is saved. And yet the savings are said to reach 90%. Would that mean most of the cost of using an LLM (Large Language Model) comes not from the model itself but from the layer around it?

© 2026 Ted Kim. All Rights Reserved. | Email Contact