DEV Community

Mykola Mizhigurskiy
Mykola Mizhigurskiy

Posted on

💥 Easy way to save your AI coding agent a surprising amount of context.

One thing clicked for me only after working with AI agents for a while.

Like many teams, I have a set of mandatory checks that must pass before code is committed:

  • Prettier
  • ESLint
  • Type checking
  • Unit tests

I also have a rule for my coding agent: whenever it makes executable code changes, it automatically runs all of these checks before moving on.

Sounds obvious, right?

The problem was that all of these tools were configured for humans, not for AI.
For example:

  • Prettier printed every file it checked - even when nothing changed.
  • The type checker produced verbose success output.
  • The test runner listed every executed test file.
  • ESLint printed a lot of informational output even when everything passed.

Then it hit me:

Every line of that output becomes part of the agent's working context.
Those hundreds of log lines aren't free. They consume context, increase token usage, and make it harder for the model to focus on information that actually matters.

Fixing the Noise

So I changed the defaults:

  • Prettier runs silently unless there's a formatting issue.
  • ESLint only reports warnings and errors.
  • Tests use a dot reporter and print detailed output only for failures.
  • Successful checks produce only a short summary.

The result?

Exactly the same safety guarantees, but with dramatically less noise.

For humans, verbose logs are mostly harmless. For AI agents, they're context pollution.

And context isn't free. Every unnecessary token is one that could have been spent reasoning about your code instead.

Sometimes the best optimization isn't a faster model—it's simply giving the model less irrelevant information to read.


Appendix: For those who prefer numbers over opinions


I rolled the repository back and measured the raw output with a tokenizer:
  • Prettier output: ~15,000 tokens
  • Test runner output: ~35,000 tokens

After enabling silent output and compact reporting:

  • Prettier: ~500 tokens
  • Test runner: ~1,500 tokens

That is roughly 48,000 tokens removed from a single validation cycle—without removing a single check or weakening the pipeline.

Same guarantees. Far less context pollution.


What configuration tweaks have you made to keep your AI coding agents focused? Let me know in the comments!

Top comments (0)