Context Management

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 β†’ DEPTH

Each 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 filesDump entire codebase
Quote relevant snippetsExpect AI to remember everything
Summarize long discussionsLet threads get too long
Start fresh when pollutedFight 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

SymptomCauseFix
AI contradicts earlier decisionsContext too longStart fresh, summarize
AI forgets file structureToo much noiseOnly include relevant files
Responses repeat themselvesContext limit hitNew chat
Wrong patterns usedOld code pollutingFresh context with current code
AI "doesn't get it"Missing horizontal contextSee 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 β†’