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
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.
| 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. |
The Advisor is on by default. To turn it off for a project, add [speed] agent = false to its .aiefficiency.toml. See Advisor settings.
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.
The flaky test failed in two runs and passed on the same files in others. Read the case study.
| 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.
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 doctorThe 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.
| 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.
- 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
aieffdirectly. 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
--forcefor 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.
Setup · Usage · Configuration · CLI · Hooks · Architecture · Measurements · Contributing