Someone Built a 14-Step Playground for Learning Context Engineering, Offline

Yesterday a small repo popped up on r/PromptEngineering, and it’s exactly the kind of thing you wish existed when you were still guessing why your agent kept forgetting stuff mid-conversation.

A dev going by u/purellmagents built a repo called context-engineering-from-scratch. Not a framework, not a production agent stack. Just 14 tiny runnable examples, each one isolating a single piece of context (system instructions, tool defs, few-shot examples, long-term memory, RAG, sub-agent outputs, conversation history, and so on) so you can watch how each piece changes what the model actually does.

Here’s the twist. It runs entirely on a local model. No API keys, no hosted service, no bill at the end of the month. You clone it, point it at a local model through Node.js, and start poking at each component one at a time.

That matters because most people learn context engineering backwards. They build a whole agent, something breaks, and then they spend three hours guessing whether it was the system prompt, the memory layer, or the tool schema. This repo flips that. You learn each ingredient in isolation before you ever combine them.

How to actually use it

  • 🔧 Clone the repo and get a local model running through Node.js first, that’s the only setup tax
  • 📂 Work through the 14 examples in order, don’t skip to the fun ones like sub-agent outputs
  • 🔍 For each example, change one variable (a line in the system prompt, one few-shot example, one memory entry) and rerun it
  • 📝 Write down what changed in the output. That’s the whole point, building the intuition, not memorizing terms
  • 🧩 Once you’ve been through all 14, go build your real agent. You’ll actually know what you’re stacking

Pro tip: don’t rush the context orchestration and context traces examples near the end. Those are the ones that show you how all the earlier pieces compete for space and attention once you put them in the same call, which is the part everyone skips and then wonders why their agent ignores half its instructions.

If you’ve been reading about context engineering without ever seeing it happen step by step, this is worth an evening. Go break it on purpose.

Built a small repo to learn context engineering from scratch with local models
by u/purellmagents in PromptEngineering

Scroll to Top