Skip to content

When It's Not Working

Signs the AI is struggling, and what to do about it.

SignalWhat’s HappeningWhat to Do
Same error 3+ timesContext polluted with failed attemptsRevert all changes, start fresh
”I’ll try a different approach” repeatedlyAI is guessing, not understandingStop. Provide more context or simplify
Changes unrelated filesAI misunderstood scopeBe explicit: “Only modify X”
Output looks plausible but wrongHallucinationTest immediately. Don’t trust unverified code
10+ iterations for simple taskWrong tool or wrong problemDo it yourself

When things go wrong:

1. git stash or git checkout . # Revert everything
2. Close the chat/session # Fresh context
3. Simplify the task # Smaller scope
4. Add explicit constraints # "Don't touch X, only modify Y"
5. Try again with one specific ask # Not "build feature" but "add function"

Code it yourself when:

  • You’ve explained the same thing 3 different ways with no improvement
  • The fix would take you 5 minutes but the AI has burned 20
  • The AI keeps “fixing” things that weren’t broken
  • You don’t understand the AI’s solution well enough to maintain it

This is not failure. Some tasks are faster by hand. Knowing when to switch is a skill.

Symptoms: Each “fix” introduces new problems. Tests that passed now fail.

Cause: AI doesn’t have full context of dependencies.

Fix:

  1. Revert to last working state
  2. Provide more context about what other code depends on this
  3. Add constraint: “Don’t change the function signature” or “These tests must still pass”

Symptoms: AI suggests packages that don’t exist, or uses API methods that don’t exist.

Cause: Training data cutoff, or confusion between similar libraries.

Fix:

  1. Provide the actual API documentation
  2. Show an example of correct usage from the real docs
  3. Use Context7 MCP for up-to-date documentation

Symptoms: Simple request results in 500 lines with factories, interfaces, and abstractions.

Cause: AI defaults to “enterprise” patterns when uncertain.

Fix:

  1. Be explicit: “Keep it simple. No unnecessary abstractions.”
  2. Show an example of the style you want
  3. Add to context file: “Prefer simple solutions over clever ones”

Symptoms: AI makes changes that contradict existing patterns or architecture.

Cause: Not enough context about how the codebase works.

Fix:

  1. Point to specific files: “Follow the pattern in src/auth/login.ts
  2. Explain the architecture: “We use repository pattern, services should not access DB directly”
  3. Create/update your CLAUDE.md or .cursorrules file

Symptoms: Same suggestion repeatedly, even after you say it doesn’t work.

Cause: Context is saturated with the failed approach.

Fix:

  1. Clear context completely
  2. Revert all changes
  3. Start fresh with a different framing of the problem

When stuck, try these prompts:

Before making any changes, explain your understanding of:
1. What the current code does
2. What change I'm asking for
3. What files will need to change
What assumptions are you making? List them before proceeding.
What could go wrong with this approach? What are the risks?

Before starting any significant task:

  • Environment is clean (no pre-existing errors)
  • Context file is up to date
  • Task is small enough to verify
  • You know how to verify success
  • You understand the code well enough to review