Audit Loop
Agent-agnostic skills for orchestrating automated audit-fix loops between AI coding agents via GitHub.
View source →Previously, I would:
- ask Codex to “Thoroughly audit this codebase and write your findings to a file”
- ask Claude to address the findings
- and iterate until all audit findings are done
Instead of manually triggering each agent (audit and address), I could automate this by placing each one in its own tmux session, and having each one use tmux send-keys to trigger the other at boundary points.
Furthermore, I switched to using GitHub issues and PRs as the shared state store instead of a local document.
I created /audit and /address to initialize the corresponding agents.
The loop
The two agents coordinate via short trigger phrases sent across tmux. The audit agent scopes the repo or a topic, files issues, and reviews each PR with a structured WRONG | INCOMPLETE | REGRESSION template. The address agent validates each issue, groups valid ones into batches (≤3 unrelated files per batch), writes root-cause hypotheses before editing, opens a PR, and revises on request. Shared state (phase, current batch, revision round, heartbeat timestamps) lives in .audit-loop/state.json so either side can crash and resume.
If any of the following are exceeded, a needs-human label is added and the loop is cancelled/continued:
- 5 PRs per cycle
- 3 revision rounds per PR
- a 30-minute stall timeout
Turning a plan into issues
For implementing a plan (e.g. generated with Claude’s /plan), I added a /issues skill that instructs an agent to properly split a plan into scoped issues.
You can initialize the address agent to start working on these issues.