Constraints in AI Coding: Why "Don't" is the Most Critical Prompt Signal
These articles are AI-generated summaries. Please check the original sources for full details.
The agent over-applies everything: why “don’t” is my most-used word
Eugene Zharkov analyzed 767 AI agent sessions across React Native and Web repositories to track correction patterns. He discovered that the word “don’t” was used 1,703 times to counteract the agent’s tendency to over-apply changes.
Why This Matters
The technical reality of agentic workflows reveals a significant gap between implicit developer constraints and AI execution, leading to a 60% correction rate in complex web environments compared to 35% in React Native. This “tax on implicit knowledge” creates a 15% session overhead, demonstrating that without explicit constraint encoding, agents prioritize global “improvements” over specific task scope, resulting in noisy diffs and broken trust in production code reviews.
Key Insights
- Correction rates scale with repository complexity: Web migrations faced a 60% correction rate compared to 35% for React Native due to more interconnected files and implicit conventions.
- The ‘Eager Editor’ failure mode: Agents often perform unrequested tasks like reformatting imports or tweaking prop types; one styling fix resulted in 52 updated SVG icons.
- The ‘Pattern Breaker’ phenomenon: Even when adjacent files are provided as context, agents may invent new structures instead of maintaining existing architectural consistency.
- Structural planning reduces overhead: A 321-line migration plan with explicit ‘do not’ boundaries resulted in 74 messages with zero corrections.
- Specificity vs. Vague Optimization: Prompts targeting specific files and behaviors produced zero corrections, while vague ‘optimize resources’ prompts generated 38 corrections over 11 turns.
Working Examples
Data classification of correction signals across 767 sessions.
Corrections: Web 60% vs RN 35%
Don't/should not: Web 1,703 vs RN 128
Keep/preserve: Web 308 vs RN 35
Over-applied: Web 182 vs RN 19
Same as before: Web 179 vs RN 13
Examples of high-specificity prompts that resulted in zero corrections.
"Update the dependency of react to the latest 18.available and check that code is compatible with react 18"
"ForgotPassword back button should not cancel the flow but make it possible to go back at the previous step"
Practical Applications
- Use case: Pinning an agent to specific dependencies and file-level scopes to prevent the ‘Maximalist’ failure mode where loading states trigger unrequested error handling logic.
- Pitfall: Using vague ‘improve’ or ‘optimize’ prompts which serve as invitations for agents to touch irrelevant files and create noisy pull requests.
- Use case: Encoding codebase opinions into a structural plan document before running agents to reduce the need for iterative tuning during the session.
- Pitfall: Relying on an agent’s ‘taste’ for architectural consistency; agents may read adjacent files but still choose creative deviations over established patterns.
References:
Continue reading
Next article
Trust-Aware API Access with OpenID Federation: Implementation Guide
Related Content
Solving AI Agent Ambiguity with Domain-Driven Design's Ubiquitous Language
AI coding agents amplify vocabulary ambiguity, leading to semantic mismatches that can result in critical production incidents.
Implementing State-Based AI Workflows with LangGraph Templates
Explore 5 reusable LangGraph agent templates for implementing state-based workflows, including RAG, multi-tool loops, and human-in-the-loop systems.
Optimizing Coding Agent Performance: Reducing Context Bloat by 22–45%
John Miller achieved a 22–45% reduction in coding agent context usage by eliminating context bloat, improving AI development efficiency.