← ContentsHome
Chapter 8

Anti-Patterns

Six failure modes: Alt-Tab Copilot, Prompt Theater, Chat-First, Log Dumping, Context Amnesia, and Diff Blindness.

Naming failure modes helps you avoid them. Here are six common anti-patterns in AI coding workflows, with concrete examples of each.


Anti-Pattern 1: The Alt-Tab Copilot

Description: The AI lives in a browser or separate app. Developers copy-paste code to it, then copy-paste suggestions back. The editor becomes a dumb text area.

Why it hurts: Every interaction is a full context switch. T_recover dominates the day.

Real example:

Developer debugging a React component. The component isn't rendering.

  1. Copy 40 lines of JSX from editor
  2. Alt-tab to ChatGPT
  3. Paste, add explanation: "This component isn't rendering, why?"
  4. Wait for response
  5. Read suggestion: "Check if props.data is undefined"
  6. Alt-tab back to editor
  7. Scroll to find the right place
  8. Manually type in the suggested fix
  9. Run app
  10. Still doesn't work
  11. Repeat

Time spent: 8 minutes. Context switches: 4. Value delivered: low.

The correct architecture:

  • Invoke AI from within editor
  • Tool already sees the component, props, and recent console errors
  • Suggestion appears as inline diff
  • Apply with one keystroke

Anti-Pattern 2: Prompt As Productivity Theater

Description: Focus is on clever prompts and templates. People share long prompt recipes. The tool requires carefully crafted inputs to work.

Why it hurts: Shifts attention to the surface of the interaction, not the structure of the work. Developers become amateur prompt engineers instead of software engineers.

Real example:

Team adopts a "best practices" prompt template:

I am working on [LANGUAGE] using [FRAMEWORK].
The relevant code is: [PASTE CODE]
The error I'm seeing is: [PASTE ERROR]
The expected behavior is: [DESCRIBE EXPECTED]
The actual behavior is: [DESCRIBE ACTUAL]
Additional context: [DESCRIBE CONTEXT]
Please provide a solution that: [LIST CONSTRAINTS]

Developers spend 5 minutes filling out this template for every question.

What's wrong:

  • The tool should infer language, framework, code, and error
  • Developer should only provide: intent and constraints
  • Template-filling becomes a tax, not a benefit

Better approach:

  • Developer types: "why isn't this rendering?"
  • Tool already has: language, framework, code, error, recent changes
  • Developer only adds constraints if needed: "don't change the API"

Anti-Pattern 3: Chat-First, Context-Last

Description: The product is designed around a rich chat interface. Integration with the codebase is thin. It feels like texting a helpful friend, not collaborating with a tool.

Why it hurts: Encourages talking about code instead of changing code. Keeps developer in explaining mode far longer than necessary.

Real example:

AI tool with beautiful chat UI, threads, history, markdown rendering. Feels like Slack.

Developer asks: "How do I add authentication to my Express app?"

AI responds with 3-page tutorial. Lots of code blocks. Beautiful formatting.

Developer reads for 5 minutes. Copies first code block. Pastes into editor. Doesn't work (missing imports). Goes back to chat. Reads more carefully. Finds imports mentioned later. Copies those too. Tries again. Different error.

Time spent: 20 minutes reading and copying. Still not working.

What went wrong:

  • Too much emphasis on conversational experience
  • Not enough emphasis on direct integration
  • Developer is the integration layer

Better approach:

  • Developer asks: "add authentication"
  • Tool shows multi-file diff with all necessary changes
  • Developer reviews and applies
  • Done in 3 minutes

Anti-Pattern 4: Log Dumping

Description: A test fails. Developer pastes hundreds of lines of logs into AI. Model gets overwhelmed. Important signals are hidden in noise.

Why it hurts: Volume without structure. AI spends tokens on irrelevant information. Often misses the actual issue because it's buried on line 487 of the log dump.

Real example:

Developer's integration test fails. CI log is 800 lines. They copy all of it into ChatGPT.

AI responds: "The error appears to be a timeout. Check your network configuration."

Actual error (buried in log line 623): TypeError: Cannot read property 'id' of undefined

Developer wasted 10 minutes. AI never saw the real error.

Better approach:

  • Tool watches test runner output
  • Automatically extracts:
    • The failing test name
    • The actual error message and stack trace
    • Relevant log lines (filtered by timestamp and log level)
  • Presents structured context to model
  • Developer doesn't need to manually sift through 800 lines

Anti-Pattern 5: Context Amnesia

Description: Every AI interaction starts from zero. Tool doesn't remember what you were just working on. You re-explain the same context repeatedly.

Why it hurts: Defeats the point of having an assistant. You spend more time training the AI than using it.

Real example:

Developer working on a multi-step feature. Over 2 hours, they ask the AI 6 questions:

  1. "How do I structure this API endpoint?"
  2. "Now how do I validate the input?" ← Has to re-explain the endpoint structure
  3. "How do I write a test for this?" ← Has to paste endpoint code again
  4. "The test is failing, why?" ← Has to paste test and endpoint again
  5. "How do I add error handling?" ← Pastes everything again
  6. "How do I document this API?" ← Pastes endpoint one more time

Each interaction requires re-providing context from previous interactions.

Better approach:

  • Tool maintains session context for the current work (e.g., this file, this feature branch)
  • Remembers recent changes and discussions
  • Developer can build on previous answers without re-explaining
  • Context automatically expires when switching tasks

Anti-Pattern 6: Diff Blindness

Description: AI provides suggestions as blocks of code to copy-paste. No diff view. Developer has to manually figure out what changed and where it goes.

Why it hurts: Integration becomes a puzzle. "Do I replace this whole function? Just add this line? Where does this import go?" Errors and rework are common.

Real example:

Developer asks: "Make this function handle null inputs safely"

AI responds:

function processUser(user) {
  if (!user) {
    return null;
  }
  if (!user.email) {
    throw new Error("Email required");
  }
  return {
    id: user.id,
    email: user.email.toLowerCase(),
    name: user.name || "Anonymous"
  };
}

Developer looks at their current code:

function processUser(user) {
  return {
    id: user.id,
    email: user.email.toLowerCase(),
    name: user.name
  };
}

Questions:

  • Do I replace the entire function?
  • What exactly changed?
  • Did it add lines or modify existing ones?

Developer manually compares line by line. Makes mistakes. Introduces bugs.

Better approach:

  • Show changes as a diff:
function processUser(user) {
+  if (!user) {
+    return null;
+  }
+  if (!user.email) {
+    throw new Error("Email required");
+  }
  return {
    id: user.id,
    email: user.email.toLowerCase(),
-    name: user.name
+    name: user.name || "Anonymous"
  };
}
  • Developer sees exactly what changes
  • One-click apply
  • If wrong, easy to revert

Recognizing Anti-Patterns in Your Workflow

Ask yourself:

  • Do I alt-tab to use AI? → Alt-Tab Copilot
  • Do I spend time crafting prompts? → Prompt Theater
  • Do I spend more time reading AI responses than applying them? → Chat-First
  • Do I paste large logs/files? → Log Dumping
  • Do I re-explain the same context repeatedly? → Context Amnesia
  • Do I manually figure out where AI suggestions go? → Diff Blindness

Each "yes" is a symptom of poor context architecture.