Context Management
This is a deep dive into steps 1-4 of the 7-Step Process β the context-building phase that happens before any code is written.
The quality of AI output is directly proportional to the quality of context you provide. This page explains how to manage that context effectively.
The Context Pyramid
From the 7-Step Process, context builds in layers:
β²
/β\ 1. USER RULES
/βββ\ (Identity + Guardrails)
/βββββ\
/βββββββ\ 2. CODEBASE STRUCTURE
/βββββββββ\ (Architecture)
/βββββββββββ\
/βββββββββββββ\ 3. SPECIFIC FILES
/βββββββββββββββ\ (Implementation)
/βββββββββββββββββ\
/βββββββββββββββββββ\ 4. RESEARCH + DOCS
/βββββββββββββββββββββ\ (External Knowledge)
βββββββββββββββββββββββββ
FOUNDATION β DEPTHEach layer builds on the one above. You can't effectively research (4) without understanding the codebase (2-3).
The Context Window is Precious
AI can only "see" so much at once. Use it wisely.
| β Do | β Don't |
|---|---|
| Reference specific files | Dump entire codebase |
| Quote relevant snippets | Expect AI to remember everything |
| Summarize long discussions | Let threads get too long |
| Start fresh when polluted | Fight with stale context |
When to Start a New Chat
A fresh context often works better than trying to fix a polluted one.
Start a new chat when:
- After shipping a feature β Clean slate for next task
- AI keeps making the same mistake β It's stuck in a loop (see Oneshot Paradigm)
- Switching to unrelated work β Old context will confuse
- Responses get confused/repetitive β Context is full
Bringing Context into New Chats
1. Reference User Rules First
"Read and understand user rules, research each for complete understanding."2. Point to Specific Files
In Cursor, use @filename.ts to bring files into context.
"Read @src/services/AuthService.ts and @src/utils/validation.ts.
Understand how authentication currently works."3. Provide Horizontal Context
From Horizon Thinking, share what AI can't see:
"Context you need to know:
- We use JWT with refresh tokens (not sessions)
- Auth must integrate with our SSO provider
- Rate limit to 5 attempts per minute
- Log all auth events to audit service"4. Summarize Previous Decisions
"In our last session, we decided to:
1. Use JWT for auth (not sessions)
2. Store refresh tokens in httpOnly cookies
3. Access tokens expire in 15 min
Now I need to implement token refresh..."Context Efficiency Tips
Be Selective
β "Here's my entire schema.prisma (500 lines)..."
β
"Here's the relevant models:
model User { ... }
model Post { ... }
"Reference, Don't Paste
β Paste 200 lines of code
β
"Look at /services/AuthService.ts, specifically the
validateToken function on lines 45-60"Signs of Context Problems
| Symptom | Cause | Fix |
|---|---|---|
| AI contradicts earlier decisions | Context too long | Start fresh, summarize |
| AI forgets file structure | Too much noise | Only include relevant files |
| Responses repeat themselves | Context limit hit | New chat |
| Wrong patterns used | Old code polluting | Fresh context with current code |
| AI "doesn't get it" | Missing horizontal context | See Horizon Thinking |
The Brainlift Connection
Your Brainlift from Eagle Sight IS context β specifically, the context that AI can't possibly have:
- Your contrarian insights
- Recent market changes
- Domain expertise
- Lessons from past failures
Always include your Brainlift when starting a new feature.
"Context is the difference between AI that hallucinates and AI that delivers."
For the full context-building process, see The 7-Step Process β