Context Engineering for AI-Assisted Development
Context windows grew 62x in two years. AI quality didn't.
A context window is not storage. It is cognitive load.
The Problem
More tokens, same confusion
LLMs can now hold 2 million tokens in context. But capacity is not comprehension. Throwing more code at a model doesn't mean it understands your intent.
A context window is not storage. It is cognitive load.
Stuffing 195K tokens into a 200K window leaves no room for reasoning.
The Solution
Three principles of context engineering
Stop treating context as infinite storage. Start engineering it like you engineer code.
Isolation
Provide the minimum effective context for each task. Scope by responsibility, not file size.
OAuth2 models + relevant controller
Chaining
Break work into stages. Pass artifacts between them, not entire conversation histories.
not conversation history (30K tokens)
Headroom
Never operate at 100% capacity. Reserve space for the model to actually think.
Leave room for reasoning
Introducing
Plan Stack
Implementation plans as first-class artifacts
Instead of letting research and decisions disappear with each /clear,
Plan Stack captures them in lightweight, reusable plans.
A 50-file investigation becomes a 300-line plan. Six months later, reviewing one plan beats re-reading 50 files and re-discovering architectural intent.
- + Compressed research for AI context
- + Long-term memory for humans
- + A reliable starting point after context reset
The Workflow
Research, Plan, Execute, Review
Each phase applies context engineering principles. The workflow creates a self-reinforcing loop where knowledge compounds.
Research
AI checks docs/plans/ for similar implementations. Never start from zero.
Plan
Generate a structured implementation plan. Human reviews before any code is written.
HeadroomExecute
Implement with the plan as guide. The plan carries intent across context resets.
ChainingReview
Compare implementation against plan. Detect drift between intent and code.
Isolation + ChainingThe Pattern
Embrace the reset
Context degradation is inevitable. Plan Stack turns /clear from a loss into a feature.
Restart at 0% context without restarting your work.
Get Started
One line to begin
Add this instruction to your CLAUDE.md:
This single line creates the self-reinforcing loop:
- 1. AI checks
docs/plans/first - 2. Finds distilled context (hundreds of tokens)
- 3. Skips reading raw code (tens of thousands of tokens)
- 4. Each new plan adds to the knowledge base
Stop fighting context limits
Start engineering context. Plans compound with every commit.