Review a local branch from Claude Code or Codex (MCP)
Add Ensemble to Claude Code or Codex as an MCP server, and your coding agent can ask Ensemble to review the branch it is working on before anything is pushed.
On this page
Your coding agent writes the code; Ensemble reviews it, with the same review it gives a pull request. You do not need to push or open a pull request first. The agent asks, waits for the result, fixes what applies, and asks again. Ensemble must be running on your machine (npx ensemble-review).
#Set it up
- Start Ensemble, and make sure the repository is in one of your workspaces and has finished its first sync.
- Claude Code: in a terminal, run
claude mcp add ensemble -- npx ensemble-review mcp. - Codex: add this to
~/.codex/config.toml:[mcp_servers.ensemble] command = "npx" args = ["ensemble-review", "mcp"] startup_timeout_sec = 60 tool_timeout_sec = 120
The two timeouts givenpxtime to download Ensemble the first time, and a review time to start. - Start a new session of the agent in your repository. Ask it to review the branch with Ensemble.
#What is reviewed
- The commits on your branch since the base: the branch's upstream when it is stacked on another branch, else the default branch on GitHub. The agent can name another base.
- Your uncommitted changes to files git already tracks, unless the agent turns them off. Files git does not track are never sent.
- The acceptance criteria, when Ensemble finds the ticket: in the branch name or a commit message (the branch name only when your workspace has project keys set in its tracker settings). Otherwise the agent passes the ticket key.
Ensemble packs the branch as a git bundle and sends it to the copy of the repository it keeps. It never writes to your repository. The base commit must already be on GitHub. A changed file that uses a git filter, such as Git LFS, is reviewed as last committed.
#The tools your agent gets
- review_local_branch: start a review. It returns an id at once; a review takes a few minutes.
- get_local_review: the result: each finding with its file, line, severity, title and text, and each acceptance criterion with its status. While the review runs, it waits up to 50 seconds per call.
- check_story: check the acceptance criteria only, with no code review.
- list_local_reviews and cancel_local_review.
One review of a branch runs at a time. If the agent starts another while one runs, it gets the running one.
#Who reviews
The same reviewers as a review you start: Settings → AI → Review. With Claude and Codex both on and signed in, both review and you get one merged review (see Claude and Codex together). The agent can ask for one of them, or another effort, for one review.
#Answer and review again
When the agent reviews the branch again, it can answer the last review: each finding (fixed, answered, pushed_back) and each open criterion (fixed, not_applicable, cannot_meet), always with a reason. The next review checks each answer, as a follow-up review does. A criterion the agent cannot meet stays not met, with its reason.
#From the terminal
ensemble review does the same in your terminal and prints the result. Add --json for the same fields the tools return, --no-uncommitted to leave out uncommitted changes, --ticket PAY-142 to name the ticket, and --story to check the criteria only. Press Ctrl-C to stop the review.
#What Ensemble writes
Nothing on GitHub, and nothing in your repository. A local review is never posted, pushed or fixed, does not start an AI Fix, and adds no card to Pending. It counts as a review you started: the AI spend limit never stops it, and its use shows in Reports → AI usage.