Don't Make the Agent Re-Run the Test Suite to Find the Failure The article describes a common failure mode where AI coding agents re-run entire test suites to identify which tests failed, despite the failure information being present in the initial output. The proposed solution is to use the Unix `tee` command to pipe test output into a gitignored `.test-output/` directory, allowing the agent to `grep` the persisted log file for failures instead of re-running the expensive test suite. This approach saves time by eliminating redundant test executions while preserving real-time terminal feedback. Here is a small failure mode that cost me time for longer than it should have. The agent would run the test suite. Tests would fail. The agent would announce that tests failed. Then, when it needed to know which tests failed, would either guess, ask, or run the suite a second time to scrape the output. Sometimes it would run it a third time. The failing tests were right there in the output of the first run; the agent didn't read them carefully enough to remember. This is not the model being lazy. It is the model being honest about its attention. Test output is voluminous, the failure summary is buried at the bottom, and by the time the agent is reasoning about the next step "which test failed, what assertion, what file" , the relevant lines have scrolled past whatever the agent actually retained. The cheapest way to get the information back is to run the command again. Running the command again is the wrong answer. A full suite takes minutes. Doing it twice to learn something the first run already told you is a tax on every red-test loop, and the loops compound. tee everything to a gitignored directory The rule I added is short: Every test command pipes through tee into.test-output/