C.W.K.
Lesson 03 of 05 · published

ContextEngine — Vault → System Prompt

~11 min · context-engine, system-prompt

Level 0Curious
0 XP0/52 lessons0/16 achievements
0/100 XP to next level100 XP to go0% complete

Load order matters

backend/context/engine.py loads the vault in a fixed sequence: Pippa.mdinstructions.mdcore/*index/*. Order matters because identity priority follows order. Files under index/ larger than 10KB get replaced with on-demand pointers — Pippa reads them via the Read tool when needed instead of bloating every system prompt.

RAG injection

The system prompt also includes RAG context (next lesson). RAG runs before the system prompt is finalized — the retrieved chunks become a section of the system prompt, not a user message.

Cache hint

The vault content is huge. The Claude SDK uses prefix caching — same vault content across sessions, same prefix, cached. Tokens billed once, reused on every session start. The cache hint is implicit; the structure is what makes it work.

Progress

Progress is local-only — sign in to sync across devices.