Phase 5: Context Engineering · 20 min · Cursor · Claude Code · Lovable
Docs vs. Chat vs. File References
The right context in the right place at the right time. Format matters.
Hiring signal: What changes when you use this: you give the AI context efficiently — which means better results with less wasted context window space.
What you will learn
- Know when to write context in a file vs. in chat
- Know when to reference existing files vs. paste code inline
- Know when to link to documentation vs. describe it yourself
- Apply the context hierarchy: context file > file references > chat > paste inline
Your Mission
Map each type of context in a project to the most efficient delivery method and identify a past mistake to fix. Output: context_delivery_plan.md.
You need: A project you're building with AI (any tool).
Time: 20 minutes.
Step 1: Learn the Context Hierarchy (5 min)
From most efficient to least efficient:
1. Context File — persistent, reusable context
- Use for: tech stack, conventions, file structure, project overview, Do NOT rules
- Why: written once, read automatically, available in every session
2. File References — existing code the AI should look at
- Use for: "Look at src/lib/supabase.ts" or "Follow the pattern in src/components/HabitCard.tsx"
- Why: in IDE tools, the AI reads the file directly — no need to paste. Sees current code, not outdated paste.
3. Chat — session-specific, one-time context
- Use for: what you're working on right now, current issues, specific corrections
- Why: fast, flexible, but consumes context window space and doesn't persist
4. Paste Inline — small code snippets or when file references aren't available
- Use for: small snippets (< 50 lines), error messages, specific functions
- Why: necessary in browser builders without file reference capabilities
The golden rule of context
Give the AI the minimum context it needs to make the right decisions — no more, no less. Too little: the AI guesses wrong. Too much: the AI's context window gets cluttered and it may miss the important parts.
Unlock the full lesson
You've read the first 2 sections. The rest of this lesson covers Step 2: Map Your Context Types (10 min), Context Delivery Plan, Step 3: Identify a Past Mistake (5 min), Past Mistake, You're Done — plus a hands-on lab, quiz, and project artifact.
Create a free account to unlock Phase 0 and Phase 1 of every course — no credit card.
Browse all courses · View pricing · DeVenture Academy