The Deska blog

The Agent Ignores Your Conventions

Learn how to stop AI tools from breaking code styles when the agent ignores your conventions in complex development projects.

· 10 min read

When a developer integrates an AI assistant into their workflow, they often face a frustrating reality where the agent ignores your conventions. You might have a specific way of handling error logging, a preference for early returns, or a strict naming pattern for private methods. Despite having a .editorconfig or a comprehensive README.md, the agent frequently defaults to generic training patterns. This tension between your established codebase and the AI generated output leads to manual refactoring, which defeats the purpose of using an autonomous tool.

Why AI Agents Drift from Local Standards

The core reason why the agent ignores your conventions lies in the probabilistic nature of Large Language Models. These models are trained on billions of lines of public code. When you ask for a new function, the model calculates the most likely next token based on its training data rather than your specific project history. Unless the context window is explicitly managed, the weight of the general training data overrides the local patterns it sees in your open files.

Lack of Global Context

Most standard IDE plugins only send the currently active file or a small snippet of surrounding code to the model. If your style guides are defined in a separate folder or if your architecture relies on patterns established in a different module, the agent simply does not know they exist. Without a holistic view of the workspace, the AI makes assumptions that favor common web patterns over your bespoke architecture.

The Conflict of Instruction Overlays

When you provide a prompt, you are layering new instructions over the model's baseline behavior. If your prompt is "Create a user authentication service," the model pulls from a vast library of generic authentication examples. If your specific project uses a custom internal library for JWT handling, the agent will likely ignore that convention in favor of a standard library like passport.js or jsonwebtoken because those are more statistically prevalent in its training set.

Strategies to Enforce Coding Standards

To mitigate these issues, you must change how you feed information to the AI. You cannot rely on the model to "feel" the vibe of your code. You must be explicit and architectural in your approach.

  • Use comprehensive system prompts that include a "Do Not" list.
  • Provide examples of "Good" vs "Bad" code within the same context.
  • Keep architectural documentation close to the code in plain text files.
  • Use tools that allow for multi-file visibility so the agent can reference existing patterns.

Documentation as Code

One effective method is to maintain a .rules or .ai-docs file in your root directory. AI agents are increasingly capable of reading project structures. If you point the agent to a specific file that defines your naming conventions and architectural layers, the success rate of the generated code increases significantly.

How Deska Improves Contextual Awareness

The environment where you run your agents matters as much as the prompts you write. Deska provides a unique approach by utilizing an infinite canvas where you can visualize the entire scope of your work. Instead of hiding files in tabs, you can place your conventions, your terminal, and your agent panels side by side.

In Deska, you can run multiple agents like Claude Code or OpenCode in dedicated panels. This setup allows you to observe how different models interpret your project. Because Deska is local-first, your code and files stay on your machine, ensuring that the agent has access to the local environment without the latency of cloud-only IDEs.

Using Ask Deska for Workspace Management

When the agent ignores your conventions, you can use Ask Deska to reorient the workspace. Since Ask Deska can drive the workspace, you can ask it to open all relevant style guides or previous implementation examples. By placing these panels on the canvas, you provide a visual and data-rich environment that helps you monitor the agent's output against your standards in real-time.

Side-by-Side Agent Comparison

Deska allows you to run coding agents like Codex CLI and Claude Code simultaneously. This is particularly useful for debugging convention drift. You can give the same prompt to two different agents and see which one respects your linter rules or folder structure more accurately.

FeatureStandard IDE PluginsDeska Workspace
Context ViewTab-based, limitedInfinite canvas, side-by-side
Agent SupportUsually single providerMultiple agents as panels
PrivacyCloud-dependentLocal-first architecture
ControlMacro-levelAsk Deska workspace control

Managing Convention Drift on the Go

Software development does not always happen at a desk. Sometimes you need to check if an agent has finished a long refactoring task while you are away. The Deska mobile app allows you to monitor your workspace through a secure relay. You can see the agent's progress and check if it has started to ignore your conventions. If you spot a deviation, you can intervene from your phone, ensuring that the code remains consistent with your project standards even when you are not at your primary machine.

FAQ

How do I stop AI from using deprecated libraries?

The most effective way is to include a specific "deprecated" section in your project instructions or a .cursorrules equivalent file. When using coding agents, explicitly tell the agent to check the package.json or requirements.txt before suggesting new dependencies.

Can agents learn my style from my git history?

Most current agents do not automatically index your entire git history due to context window limits. However, tools that integrate with terminals can be instructed to run git log or git show on specific files to see how you solved similar problems in the past.

Does a local-first approach help with code consistency?

Yes, a local-first approach ensures that the agent has direct, low-latency access to your entire file system. This allows the model to reference local configuration files and hidden dotfiles that contain your formatting and linting rules more reliably than a web-based editor.

Getting Started with a Structured Workspace

Consistency in AI generated code requires a workspace that mirrors your mental model. By organizing your terminals, editors, and agents on a single canvas, you reduce the friction of context switching. If you are tired of manual refactoring because your agent ignores your conventions, try a more visual and local approach to development.

You can download Deska for Mac, Windows, and Linux to start building your own infinite canvas today.

💡 Ideas+🐛 BugsSuggest a feature or report a bug