ai agents claude-code antigravity gitlab code-review workflow

Two AI Coding Agents, One Inbox and One Outbox

· 6 min read
On this page

If you use two AI coding agents on the same project, you can easily become the messenger between them. You copy what one agent built into the other’s prompt, repeat decisions, and find out late that the two halves of a feature don’t fit together.

I use Claude Code for the backend and Google’s Antigravity for the frontend, and they communicate through two markdown files that I can also read. The files are simple, and most of the work went into the rules I added when the agents got things wrong. You can use those rules with any pair of coding agents, and some of them help even if you have only one.

The inbox and the outbox

Claude Code plans the work and reviews Antigravity’s code, and it writes its instructions in the inbox. Antigravity reads the inbox and replies in the outbox. Neither agent edits the other’s file, and each agent has its own part of the code.

The inbox has three parts:

  1. A board that lists each task and whether it is WAITING, READY or DONE.
  2. Numbered messages, newest first.
  3. Numbered review comments on Antigravity’s work.

The outbox holds Antigravity’s current status, a reply to each message by its number, and any decision it made where the instructions left a choice. A reply looks like this:

ACK M-042
The page now uses only the date that the API returns.
Added a test for an item that has no date.

M-042 is the number of the message it answers. The numbers let an agent refer to one exact instruction, and let me search for the reply to it.

A third file, the brief, holds the goal, the list of tasks and the rules. Antigravity works in a loop. It reads the brief and the inbox, fixes any review comments, takes the next task that is ready, and starts again. The brief includes the sentence “Do not declare the goal complete because nothing is ready right now”, because an agent with nothing to do may decide that it has finished.

Agree on the data first

When one agent builds the backend and another builds the frontend, the frontend agent has to know what data it will receive. Before Antigravity starts a task, Claude Code writes a contract for it. The contract says which API addresses the frontend will call, what it must send, what data comes back and which errors to expect. The task changes to READY only when the contract exists.

When Antigravity writes tests, its sample data has to match the contract. If it needs something that the contract doesn’t have, it must ask for it and continue with the rest. I added this rule because some of its earlier tests used sample data based on its own assumptions, and tests like that can pass even when the frontend doesn’t work with the real API.

The rule only works if the contract is complete. In one task, Claude Code left out a date that the frontend needed. Antigravity used another date without asking, and its tests passed. Claude Code found the mistake in review and added the missing date to the API.

Collect test evidence with a script

When an agent finishes a task, it opens a merge request and describes what it tested. I learned not to rely on that description. Before I had these rules, Antigravity opened 20 merge requests in two days, and 11 of the 20 descriptions contained false or outdated evidence. Some named tests that didn’t exist. Some said that all the tests passed when some had failed.

I replaced the description with the output of a shell script. Antigravity runs it and pastes the output into the merge request without editing it. The script does five things:

  1. It checks out the branch in a temporary git worktree, so files that were never pushed can’t affect the result.
  2. It merges the latest version of the target branch, and stops if there is a conflict.
  3. It lists the files that changed.
  4. It lists the tests that the change adds or edits, read from the code.
  5. It runs all the tests in a container and prints the totals and any failures.

It also prints the commit IDs, so a reviewer can see which code was tested and run the script again to compare.

The output can’t show that the tests check the right thing. The change with the wrong date had passed every test, so a reviewer still has to read the code.

Limit the work waiting for review

An agent can write code much faster than you can review it. Antigravity once opened 44 draft merge requests in about 18 active hours, when the limit was two. The limit is now a step in its loop, so it counts the open merge requests before it takes a new task.

Every merge request also opens as a draft, and Antigravity never marks one ready. I added that after a bot that merges approved work merged two of them before Claude Code had reviewed them.

Check what the tests don’t

During review, Claude Code removes a safety check from the code and runs the tests again. If they still pass, nothing tests that check, and Antigravity has to add a test for it.

Claude Code also opens new pages in a browser, because tests can miss a broken link. One page had passed more than a thousand tests, but two of the links that led to it didn’t work and a third opened a different page.

What I would change

I have used this setup for three rounds of work. Antigravity finished 26 of its 38 tasks, and Claude Code took over the rest, mostly to meet deadlines. I didn’t give the same tasks to one agent, so I can’t say that two are faster.

The inbox keeps growing, and Antigravity reads all of it on every pass, so finished rounds should move to an archive. I also want a script to assign the message numbers, because two messages once had the same one. Finally, I want the merge step to refuse any merge request that has no written review.

If you want to try this

  • Give each agent its own part of the code.
  • Let each agent write to only one file, and number every message.
  • Write down what the backend will return before the frontend is built, and tell the agent to ask when something is missing.
  • Take test results from a script, and treat the agent’s own description as unverified.
  • Open every merge request as a draft, and limit how many can wait for review.