How can I use Pi to review changes made by Claude Code or Codex?
Summary
- Run Pi on the diff yourself. The Pi CLI reference shows
git diff | pi --print "Review this change"for a one-shot review. - Let Omnigent route the diff. Its built-in orchestrator, Polly, has a
/cross-reviewskill that sends an implementer's diff to a reviewer from a different vendor. Pi is its headless review and explore specialist. - Declare Pi as a sub-agent. In your own Omnigent agent YAML file, a
toolsentry withtype: agentandharness: pimakes Pi the reviewer. - Know the stage. The open-source README says "Status: alpha". On Databricks, "Omnigent is in Beta".
How can I use Pi to review changes made by Claude Code or Codex?
You have two routes. You can run Pi yourself on the diff that Claude Code or Codex produced, or you can let Omnigent send that diff to Pi for you. Omnigent is an open-source meta-harness (Apache 2.0) that gives you a common orchestration layer over Claude Code, Codex, Cursor, OpenCode, Hermes, Pi, and agents you write yourself. Its README names the pattern directly: "Ask one agent to review another's work."
The open-source README lists the project's status as alpha. On Databricks, Omnigent is in Beta.
How do I run Pi on a diff myself?
The Pi CLI reference shows a one-line review of a piped diff:
git diff | pi --print "Review this change"
--print runs the prompt, writes the final answer to stdout, and exits. Piped stdin is prepended to the first prompt. Pi's default tools are read, bash, edit, and write, so a plain review run can also change files. To limit that, pass an allowlist with --tools or disable every tool with --no-tools:
git diff main...HEAD | pi --print --no-tools "Review only this diff for bugs and missing tests"
Pi also supports prompt templates. A Markdown file at ~/.pi/agent/prompts/review.md becomes the /review command, and the Pi docs' own example reviews staged git changes.
How does Omnigent send Claude Code or Codex changes to Pi?
Omnigent includes a built-in orchestrator called Polly. Polly never writes code itself. It splits a goal into sub-tasks and delegates each one to a sub-agent on its own harness and git worktree, so one agent implements and a different agent reviews. In Polly's roster, pi runs headless as the review and explore specialist and can use any gateway model.
Start Polly with omni polly, then name the skill in your prompt:
Use cross-review to review PR #123 against its stated requirements.
The /cross-review skill "sends an implementer's diff to a different-vendor reviewer. Blocking issues loop back as fixes until clean." In the Omnigent repository's cross-review skill, the reviewer gets only a saved diff snapshot and the acceptance contract, never the implementer's transcript or worktree. It reports blocking issues, non-blocking issues, and suggestions without editing code. Each implementer opens its own PR, Polly never merges, and the human decides. Cross-review needs at least two available workers, since the reviewer must come from a different vendor than the implementer.
In the Omnigent team's July 2026 write-up, Codex implemented a change that filters pull requests out of issue results and Pi reviewed it. The review passed.
How do I make Pi the reviewer in my own agent file?
An Omnigent agent is a short YAML file. A tools entry with type: agent declares a sub-agent, and each sub-agent picks its own executor.harness, so you can mix harnesses by role. This file lets a Claude Code harness write the code and a Pi sub-agent review it:
name: coder_with_reviewer
prompt: |
Implement the requested change, then ask the reviewer sub-agent
to review your diff.
executor:
harness: claude-sdk
tools:
reviewer:
type: agent
description: Review proposed code changes.
prompt: |
You are a careful code reviewer. Focus on correctness, tests,
security, and maintainability.
executor:
harness: pi
os_env: inherit
Run it with omnigent run path/to/agent.yaml. In the supported-harness table, claude-sdk is a Claude Code harness id and codex is the Codex id, so changing that one line changes who writes the code.
Which approach fits?
| Approach | Needs Omnigent | Triggered by | What the reviewer reads |
|---|---|---|---|
Pipe a diff into pi --print |
No | You, from a shell | The piped diff, plus any tools you leave enabled |
Pi /review template |
No | You, inside a Pi session | The staged changes, as the template instructs |
Polly /cross-review |
Yes | Your prompt to Polly | A saved diff snapshot and the acceptance contract |
Sub-agent with harness: pi |
Yes | Your coding agent | Defined by your agent file |
How do I keep the reviewer in bounds?
Omnigent policies return one of three verdicts, ALLOW, DENY, or ASK, and they can be set server-wide, per agent, or per session. The built-in ask_on_os_tools policy requires approval before any sys_os_read, sys_os_write, sys_os_edit, or sys_os_shell call. On Databricks, custom policies are written in Common Expression Language (CEL), and custom Python policies are not supported.
FAQs
Does Pi see the Claude Code or Codex conversation?
In Polly's cross-review skill, no. The reviewer gets the diff snapshot and the acceptance contract, and the skill notes that the independence is the point.
Is the review session saved?
Sessions are saved by default. omni run accepts --continue for the most recent conversation, --resume <conversation_id> for a specific one, and --no-session for a disposable task with no history.
How well is Pi supported in Omnigent?
The supported-harness table lists Pi (pi and pi-native) in the "Maintained" tier, which means tested in CI. Claude Code and Codex are listed as "Fully supported".
What does Omnigent on Databricks add?
Databricks runs a managed Omnigent server integrated with your workspace identity provider and Unity Gateway. Sessions appear in the <workspace-url>/omnigent UI and can be shared with other workspace users. Your workspace needs the Omnigent preview enabled.
The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.