PrumoGrid

HomeLearnRecipesTwo agents and a handoff file

RECIPES / 02

Two agents and a handoff file

Claude Code reviews the coupon module and writes its findings to REVISAO.md; Codex reads the file, fixes the first finding and runs the tests.

Updated for PrumoGrid 0.5.11

The scenario

You want a second opinion before fixing: one agent reviews, another fixes. In loja-api, Claude Code reviews src/cupom.cjs without changing code and writes its findings to REVISAO.md. Then Codex reads that file, fixes only the first finding and runs npm test.

Watch the video

VIDEO 05 · 0:55

Two agents, one workflow. Claude Code reviews, Codex fixes and runs the tests, with a file as the bridge between them. Captions and transcript ↗

Why a file

Claude Code and Codex are different programs, each with its own conversation. When the Codex stage starts, Codex knows nothing about what Claude Code read or concluded. PrumoGrid delivers the second stage's instruction to the Codex terminal when the first one is done, but it does not copy the history of one conversation into the other.

That is why the first stage writes what it found to a file in the project, and the second starts by reading that file. The file also stays for you: you can read it, fix it by hand or keep it in the repository.

Step by step

First stage: the review

  1. Select loja-api and click Flow and then Create flow.
  2. Write the task:

    Review src/cupom.cjs and write up to three findings to REVISAO.md, with file and line. Do not change the code.

  3. Check the summary (Claude Code · loja-api), click Review stage and then Add to plan.

Second stage: the fix

  1. Click + New stage, at the top. With the flow planned, it opens in Add to the flow, after stage 1.
  2. Runs on: Codex CLI. In Where this stage runs, a new terminal.
  3. Starts: once stage 1 is done.
  4. Task:

    Read REVISAO.md, fix only the first finding and run npm test.

  5. In On creation, choose Plan only and confirm with Add to plan.

Run

  1. Click Run flow and switch to the Grid.
  2. Claude Code reviews and writes REVISAO.md. Meanwhile, the Codex terminal stays open, waiting.
  3. When the review is done, the instruction reaches Codex. It changes the coupon and runs npm test.
  4. In Flow, both stages appear as completed, and each one has its result.
Both stages completed. The second shows that it was done because the command passed.

What to check

  • Read REVISAO.md: do the findings have a file and a line?
  • Does git diff show changes only in what the first finding asked for? If Codex touched package.json or several files, send it back with a more precise instruction.
  • npm test passed in the Codex terminal. For that to count as a criterion, and not only as a report, mark the second stage as done when the command passes. See Verification.

Tips

  • In the handoff file, write what the next agent needs to start: the problem, where it is and what must not be changed. A fixed format ("finding, file, line, suggestion") helps.
  • If the stages run in different worktrees, point to a path the second agent can read, for example a file in the project's main folder.
  • Ask the first stage not to change code. That way, if the review is wrong, nothing needs to be undone.
  • To send work back to the first agent, add a new stage with the right destination. Changing only a stage's role does not transfer a task that has already started.

Limitations

  • The sandbox of some CLIs, in read-only mode, can stop the agent from writing files or from reading files outside the folder. In that case the stage can end without the file. Command verification is what catches this.
  • A stage's instruction takes up to 512 characters, on a single line. For long context, point to a file in the project.