Auto lint-and-test fix loop with Aider
Our verdict
A simple setting that makes any agent noticeably more reliable: it closes the loop with your own checks. If you set up only one thing, set up this.
- Who it's for
- Anyone using Aider on a project with tests
- Leverage
- Agent self-corrects against your checks
- Effort
- Low
- Date added
What it does
Aider can automatically lint and test code after each change. If lint or tests fail, it sees the errors and tries to fix them.
How builders use it
- Set --lint-cmd and --test-cmd (or the YAML config equivalent).
- Enable --auto-test so tests run after every edit.
- Keep the test command fast, scoped to relevant tests where possible.
What to expect
Fewer broken commits and less babysitting of the agent.
Copy this: Command
aider --lint-cmd "npm run lint" --test-cmd "npm test" --auto-test
# then in chat:
/add src/lib/pricing.ts src/lib/pricing.test.ts
Fix the rounding bug described in issue #42. Keep tests green.Related discoveries
- Coding & Shipping AgentsUse case
Give your agent a conventions file
A short CONVENTIONS.md stops agents from fighting your style every session.
Effort: Low
- Vibe-Coding & Prompt-to-AppUse case
Write a one-page spec before you vibe-code
Ten minutes of spec saves hours of the AI going in circles.
Effort: Low
- Vibe-Coding & Prompt-to-AppUse case
Let your agent click through your app with Playwright MCP
Give the agent a real browser so it can check its own UI work.
Effort: Low
- Coding & Shipping AgentsTool
Claude Code
A terminal-first coding agent that reads your repo, edits files and runs commands.
Effort: Low
Want more like this?
Practical discoveries, without the noise.