Skip to content
ML2
Coding & Shipping AgentsUse casetestingAiderworkflow

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

Want more like this?

Practical discoveries, without the noise.