Skip to content

Anti-Patterns to Avoid

These are the most common failure modes we observed in research and experiments. Recognizing them early saves significant time and frustration.

Pattern: Start with one task, ask about something unrelated, go back to the first task, explore a third topic. The context fills with irrelevant information from multiple topics.

Fix: Clear/reset your context between unrelated tasks. Each task gets a fresh, focused context.

# Bad — accumulated context from 3 unrelated tasks
> Fix the auth bug
> [2000 tokens of auth code]
> How does the billing module work?
> [3000 tokens of billing code]
> Now go back to that auth bug
> [Agent has 5000 tokens of billing noise in context]
# Good — clear between topics
> Fix the auth bug
> [resolved]
> [clear or reset context before starting the next task]
> How does the billing module work?

Pattern: The agent does something wrong. You correct it. Still wrong. Correct again. Context is now polluted with multiple failed approaches, and the agent is “confused” by the conflicting instructions.

Fix: After two failed corrections, start a fresh session and write a better initial prompt that incorporates what you learned from the failures.

Pattern: Your agent configuration file grows to 400+ lines with detailed style guides, file-by-file descriptions, full API documentation, and tutorials. The agent ignores half of it because important rules get lost in the noise.

Fix: Ruthlessly prune to under 60 lines. Move domain-specific content to skills. Delete rules the agent follows naturally. Ask: “Would removing this cause a concrete mistake?“

Pattern: The agent produces plausible-looking code. You scan it briefly, looks fine. Ship it. The edge cases aren’t handled, and a bug reaches production.

Fix: ALWAYS provide verification mechanisms. Tests, type checking, linting, screenshot comparison. If you can’t verify it, don’t ship it.

Pattern: Ask the agent to “investigate” or “look into” something without scope boundaries. It reads 40+ files, consuming most of the context window with exploration data that may not be relevant.

Fix: Either scope investigations narrowly (“check src/auth/ for how token refresh works”) or delegate to sub-agents so exploration doesn’t consume main context.

Pattern: Ask the agent to implement an entire feature in one session. Context fills with file reads, failed approaches, and partial implementations. Quality degrades as the session progresses.

Fix: Decompose into phases (Research → Plan → Implement) with compaction between each. For large features, decompose into multiple independent implementation tasks.

Pattern: Fill your agent configuration file with formatting rules, indentation preferences, and naming conventions that a linter could enforce deterministically.

Fix: Use Biome, ESLint, or Prettier with pre-commit hooks. LLMs are expensive and unreliable at enforcing style. Reserve your configuration file for instructions that require judgment.

Pattern: Ask the agent to immediately implement a complex feature without research or planning. It picks the first approach that seems reasonable — which may be wrong for your architecture.

Fix: For any task touching more than 2-3 files, use the three-phase workflow: Research → Plan → Implement.

Pattern: Paste 2,000 lines of code into the prompt “for context.” Most of it is irrelevant, consuming context budget for zero signal.

Fix: Reference files by path. Let the agent read what it needs. Provide just the relevant section if you must paste.

# Bad
Here's the entire auth module: [2000 lines]
Add rate limiting.
# Good
Add rate limiting to the auth middleware.
See src/middleware/auth.ts for the current flow.
Follow the pattern in src/middleware/cors.ts.

Pattern: Use your tool’s initialization command to generate a configuration file and never edit it. The auto-generated file includes generic advice and descriptions the agent doesn’t need.

Fix: Your agent configuration file is one of your highest-leverage files. Manually craft every line. Remove anything that doesn’t prevent a concrete mistake.

If you notice any of these symptoms, you’ve likely hit an anti-pattern:

SymptomLikely Anti-Pattern
Agent ignores your configuration file rulesOver-specified configuration (#3)
Agent asks questions answered in the configuration fileAmbiguous phrasing in the configuration file
Agent’s output quality decreases over sessionKitchen sink (#1) or infinite exploration (#5)
Multiple correction attempts failCorrection spiral (#2)
Agent picks wrong architectureNo-plan jump (#8)
Bugs reach productionTrust-then-verify gap (#4)
Context fills quicklyCopy-paste dump (#9) or infinite exploration (#5)