Smell #3: Context Flood

Severity: Medium

Context Flood: Providing massive amounts of unstructured code or documentation to an AI in a single prompt. This "big dump" overwhelms the model's reasoning capacity and leads to generic or buggy output.

Symptoms

How to recognize this smell in your workflow:

  • [ ] You are pasting 1,000+ lines of code into a single chat turn.
  • [ ] The AI response says "I've updated your code" but ignores half of your constraints.
  • [ ] The AI "hallucinates" variables or functions that don't exist in your project.
  • [ ] Your AI API bill is exploding due to massive token usage per prompt.

Self-Assessment

If you checked 2+ items, you are flooding your AI context.

Example

Bad Pattern (The Context Dump)

❌ "Here is my entire App.jsx (1,347 lines) and my server.js (583 lines). 
    Add real-time notifications using WebSockets."

Why it's bad: The AI's "attention" is split across 2,000 lines of noise. It might propose a WebSocket solution that ignores your existing Redux state or security middleware because those details were "lost in the middle" of the flood.

Clean Alternative (Curated Context)

✅ "I have a React app using Redux. I want to add real-time notifications.
    Here is the relevant Redux slice (50 lines): [code]
    Here is the existing API structure: [docs/api.md]
    Implement the WebSocket handler following our existing auth pattern."

Why it's better: High signal-to-noise ratio. The AI can focus its reasoning on the specific task at hand.

Debt Impact

This smell contributes to:

| Debt Category | Impact | |---------------|--------| | 🏗️ ARCH | AI makes assumptions about global state that lead to tight coupling. | | 💸 FIN | Token waste leads to escalating API costs. |

How to Fix

  1. Audit Dependencies: Look for "Implicit Coupling" created during flooded sessions.
  2. Modularize Context: Break your documentation into small, high-signal files.
  3. Refactor for Decoupling: Fix the "Magic Threads" that the AI created between distant modules.

How to Prevent

  • The 500-Line Limit: Try to keep the provided code context under 500 lines per turn.
  • Reference, Don't Paste: Use tools like @file in Cursor or specialized context-loading rules.
  • Standardized Instruction Files: Use .cursorrules to provide high-level context without re-pasting it.

Related Smells

Book Reference

  • Chapter 3: Context is King — how more information ≠ better understanding.
  • Chapter 13: Clean Prompts — the "Curated Context" methodology.

Prompt with high signal, not high volume