The Deska blog
Managing Agents in a Repo With Strict Linting
Learn strategies for running AI agents in a repo with strict linting rules using local-first tools and manual review workflows to maintain code quality.
10 min read
Running autonomous agents in a repo with strict linting creates a unique friction between rapid generation and static analysis compliance. When an AI agent attempts to refactor code or implement a new feature, it often ignores the nuanced configuration of ESLint, Prettier, or Ruff. This results in a feedback loop where the agent writes code, the CI or pre-commit hook rejects it, and the agent spends expensive tokens trying to fix stylistic errors instead of logic. Successful integration requires a robust setup where the agent perceives the linting environment as a hard constraint rather than an optional suggestion.
The Challenge of Static Analysis for LLMs
Standard Large Language Models generate code based on probabilistic patterns. While they understand general syntax, they frequently miss project-specific rules defined in local configuration files. In a repository with strict linting, a single missing trailing comma or an incorrectly ordered import can halt the entire pipeline.
Agents often struggle with these environments because they operate in a sandbox that might not have the full context of the project's build toolchain. If the agent does not have access to run the linter itself, it remains blind to the errors it creates. This leads to a common failure mode: the developer accepts a pull request from an agent only to find that the build fails due to a trivial formatting error.
Common Failure Points
- Overwriting configuration files: Some agents attempt to "fix" linting errors by loosening the rules in the config files rather than fixing the code.
- Infinite loops: The agent fixes one error, which triggers another rule, leading to a repetitive cycle of edits.
- Token waste: Spending half of a prompt's context window on correcting indentation or semicolon placement.
Strategies for Harmonious Agent Integration
To effectively use agents in a repo with strict linting, you must bring the linter into the agent's inner loop. The goal is to make the linter an ally that provides immediate feedback during the generation process.
The Lint-Driven Development Loop
Instead of letting the agent run free, configure your workflow so that the agent must execute a lint command after every file modification. This mirrors the behavior of a human developer who relies on an IDE to highlight red squiggles.
- Initial Generation: The agent writes the logic for the task.
- Validation: The agent runs the project's specific linting command, such as
npm run lintorflake8 .. - Self-Correction: The agent parses the error output and applies fixes before declaring the task complete.
Using Local-First Workspaces
A local-first approach is essential for this workflow. Tools that run locally allow the agent to interact directly with your file system and your installed node_packages or python environments. This is where Deska provides a distinct advantage. Because the workspace runs on your machine, agents like Claude Code or Codex CLI have direct access to your exact linting binaries and configurations.
Organizing the Agent Environment
The layout of your development environment determines how quickly you can spot and fix agent-induced errors. Traditional IDEs often hide the agent's terminal output in a small bottom panel. A more effective approach uses an infinite canvas to spread out the context.
Multi-Panel Orchestration
When working with complex linting rules, it is helpful to see the code, the agent's thought process, and the linter output simultaneously. You can achieve this by placing multiple panels side by side. For example, you might have one terminal running a file watcher that auto-lints, while another terminal runs the agent.
Within the Deska workspace, you can place these terminals anywhere on the canvas. This spatial organization prevents you from losing track of the agent's actions. If the agent makes a mistake, the linter panel immediately flashes red, allowing you to intervene through Ask Deska or by manually editing the code in the integrated Monaco editor.
Comparing Agent Interfaces
Different tools approach linting integration with varying levels of success.
| Tool | Environment | Linting Integration |
|---|---|---|
| Cloud IDEs | Remote Container | Requires manual config |
| Deska | Local-First | Native access to local bins |
| Standard Terminals | CLI Only | Hard to visualize state |
While cloud-based IDEs offer great portability, they often differ in approach by requiring you to mirror your local environment perfectly in a container. Local-first tools like Deska remove this step, as the coding agents use the same environment you use for manual coding.
Automation and Monitoring
Monitoring an agent's progress is critical when the rules are strict. If you are away from your desk, you risk the agent getting stuck in a loop of linting failures.
Remote Monitoring
Using a mobile app to monitor these tasks allows you to keep an eye on long-running refactors. You can see if the agent has successfully passed the linting stage or if it has stalled. If a failure occurs, you can use the secure relay to pause the agent or send a quick instruction to ignore a specific rule for a single file.
Context Management
Strict linting often involves complex configurations like .editorconfig or deeply nested tsconfig.json files. Ensure your agent's context includes these files. If the agent understands the rules before it starts writing, the number of errors decreases significantly. You can use notes in your workspace to store specific commands or "rules of engagement" that you copy-paste into the agent's prompt at the start of a session.
FAQ
How do I stop an agent from ignoring my .prettierrc?
The most effective way is to include the linting check as part of the agent's success criteria. Instruct the agent that a task is not finished until the specific lint command returns a zero exit code. Using a tool that integrates the terminal and editor makes it easier for the agent to verify its own work against your local config.
Can AI agents handle auto-fixable linting errors?
Yes, most agents can run commands like eslint --fix. However, you should monitor this closely. Sometimes the auto-fix might change the logic of the code in subtle ways, especially with complex functional programming rules. It is best to have the agent run the fix and then review the diff manually in a code panel.
What is the best way to visualize agent errors?
A spatial workspace is ideal for this. By using an infinite canvas, you can keep the linter output, the agent's logs, and the actual code files visible at once. This avoids the constant tab-switching that leads to developer fatigue and missed errors.
Getting Started with Local Agents
Integrating agents into a repo with strict linting does not have to be a source of frustration. By choosing a local-first workflow, you ensure that the AI has the same view of the world that you do. This transparency leads to higher quality code and fewer broken builds.
To experiment with running multiple agents side by side in a flexible, local environment, you can download the Deska app for Mac, Windows, or Linux. Start by setting up a canvas for your project and adding your preferred coding agent as a panel to see how it interacts with your existing linting rules.