Skip to content

About

Records every test run of your AI coding agents, lets them reuse a passing result instead of repeating it, and shows where their test time goes.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

AIEFFICIENCY

AIEFFICIENCY records every test run of your AI coding agents, lets them reuse a passing result instead of repeating it, and shows where their test time goes.

Version 1.8.5 · Windows · Python 3.11+ · no runtime dependencies · MIT license

Install · Setup guide · Commands · Real example · Changelog

AI agent A runs the tests, which take 20 minutes. AIEFFICIENCY records receipt 42: passed, files unchanged, environment unchanged. AI agents B and C get receipt 42 with no wait. A changed file, a different environment or a deliberate second run starts a fresh check.

In plain words

Think of a shift log on a factory floor. When one AI agent runs the tests, AIEFFICIENCY writes down what was tested, on which files, in which environment, and the result. The next agent reads that entry instead of running the same 20-minute suite again. If a file or the environment changed, the entry no longer applies and the check runs fresh.

It works with any AI coding agent that can run a shell command. Everything runs locally in plain Python. AIEFFICIENCY itself calls no AI model. When a long check fails or slows down, it asks your agent to start a read-only Advisor subagent, and your agent decides whether to run it.

What it does

Nine features: a receipt for every check; holds needless repeats; agents reuse a passing run or wait for a running one; suggests the next check; heavy checks take turns; brings checks and lessons back after a context reset; spots flaky tests and failures from elsewhere; shows where time went; calls AI only when needed.
When What AIEFFICIENCY does
An agent repeats a check that passed The earlier receipt is returned instead of a new run when the command, folder, files and environment are the same, the run took 15 seconds or more and is less than 6 hours old. The hooks hold only the first repeat, so running the command once more starts a fresh check. aieff run reuses the receipt until you add --force.
An agent starts a check that is already running aieff run waits for the running check instead of starting a second copy.
An agent has edited files aieff plan lists targeted tests with the reason for each, says when the full suite is needed and which changed files no test covers.
A long check is about to start It warns when the result may be stale before the run ends, for example while the branch keeps getting new commits.
A check fails It says when the same failure already appeared on another state of the repository, so the edit is probably not the cause, and when a test looks flaky.
A session resumes or its context is compacted Through the hooks, a short card brings back the checks that still apply, the checks running now and confirmed lessons from earlier work.
You want to know where the time went aieff report --losses shows waits and other time losses. aieff report --speed covers long runs: failures, flaky tests and slowdowns. aieff report --durations lists the slowest tests.
An agent process seems stuck aieff watchdog scan reports sustained high CPU, orphaned processes and memory growth. It only observes and never stops a process.

How it works

Step 1: an agent runs a test or a check. Step 2: plain Python records the result. If there is no real problem, the agent keeps working and no model is called. If there is a real problem, the read-only AI Advisor, on by default, gives advice to the agent.

The Advisor is on by default. To turn it off for a project, add [speed] agent = false to its .aiefficiency.toml. See Advisor settings.

What it can save

Three agents need the same 20-minute test run. Without AIEFFICIENCY each runs it: 60 agent-minutes. With it, one run is shared: 20 agent-minutes, 40 minutes saved. Over 30 days on one installation, held repeats saved 8.7 minutes.

Your savings depend on how often your agents repeat the same check. The 8.7 minutes in the picture were 0.29% of all check time on that installation. The measurements page has the details.

A real example

Six full test runs of Project_X took 100.7 minutes: 43.7 minutes for 3 passing runs, 33.7 minutes for 2 runs that failed on the same flaky test, 23.3 minutes for 1 other failure.

The flaky test failed in two runs and passed on the same files in others. Read the case study.

Where it helps most

Situation What you get
Several agents or sessions work in one repository One passing run serves all of them
The full test suite takes minutes, not seconds Fewer long repeats and shorter waits
Tests sometimes fail for no clear reason A report of flaky tests and the time they cost
Big suites from different projects share one machine Heavy checks take turns; light commands keep going

It does little for a suite that finishes in under 15 seconds: repeating such a check is cheaper than holding it, so AIEFFICIENCY lets it run.

Install

Step 1: run install, one command that backs up your settings first. Step 2: agents get hooks and a rules block in each coding client's settings. Step 3: the agent adds .aiefficiency.toml to a project on first use. Uninstall removes only AIEFFICIENCY's entries.

Put the repository in a permanent folder. In PowerShell, from that folder:

python -I -B bin\aieff.py install --dry-run --client all
python -I -B bin\aieff.py install --client all
python -I -B bin\aieff.py doctor

The first command only shows what would change. install backs up every file it edits, and your own text in them stays as it was. Some coding clients ask you to approve new hooks once; start a new session afterwards. To type aieff instead of the full path, add the repository's runtime\ folder to your user PATH.

The first time an agent works in a project that has tests, it creates .aiefficiency.toml and a .gitignore entry for test reports, then tells you which files it created. To write them yourself, follow the setup guide.

To remove the hooks and the rules block, run python -I -B bin\aieff.py uninstall --client all.

Everyday commands

Command What it does
aieff run -- <test command> Runs a check and records a receipt
aieff run --background -- <test command> Starts the check and returns its receipt number at once
aieff wait 42 Waits for check 42 to finish, without polling
aieff result 42 Shows the outcome of check 42 and whether it still applies to the current files
aieff result --list Lists recent receipts of the project
aieff plan Suggests the next check: a targeted one or the full suite
aieff slot Shows which heavy check holds the machine and who waits
aieff report --speed --run 42 Shows where the time of run 42 went
aieff report --losses --days 7 Shows waits and other time losses of the last week

Use the receipt number your run printed in place of 42. When you need a fresh run, for example after a database or a network service changed, use aieff run --force -- <command>. All commands are in the CLI reference.

Support and limits

  • Windows is the tested platform. Linux and macOS are partly covered.
  • The automatic hooks and the rules block are installed for two coding clients today: Claude Code and Codex. Any other agent can call aieff directly. The Advisor runs as a read-only subagent that the session's lead starts in its own client (Claude Code or Codex); a project can instead let AIEFFICIENCY run it through the Claude Code CLI.
  • A result is reused only when AIEFFICIENCY can see that nothing changed. Databases, network services and some environment changes are invisible to it, so use --force for checks that depend on them.
  • For an exact exit code and a complete receipt, run checks through aieff run.
  • The machine slot coordinates only the commands that go through it. A direct shell run can bypass it.
  • Savings beyond skipped repeats, such as fixing a flaky test or following Advisor advice, are not measured yet.

Documentation

Setup · Usage · Configuration · CLI · Hooks · Architecture · Measurements · Contributing

About

Records every test run of your AI coding agents, lets them reuse a passing result instead of repeating it, and shows where their test time goes.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages