I wanted a loop where an AI writes code and pushes it to version control, I review it, and the agent reads those reviews and acts on them. Gerrit caught my eye: a code review tool built on top of Git that reviews on a per-commit basis rather than per-pull-request. That commit-centric model is unusual, and I wanted to feel it out.

Honest takeaway up front: it did not make the agent loop noticeably smoother for me. But it was a fun thing to wire up, and the setup below is the smallest version I landed on.

Start Gerrit in Docker

One container, two ports: the web UI on 8080 and SSH on 29418.

Terminal window
docker run -ti -p 8080:8080 -p 29418:29418 gerritcodereview/gerrit

Add an SSH key

The REST API can take a public key directly:

Terminal window
curl -u admin:secret \
-X POST \
-d '{"ssh_public_key": "'"$(cat ~/.ssh/id_rsa.pub)"'"}' \
http://localhost:8080/a/accounts/admin/sshkeys

This did not actually work for me, so do it by hand instead at http://localhost:8080/#/settings/ssh-keys.

Create a project

Terminal window
ssh -p 29418 admin@localhost gerrit create-project vibecode --branch main

Creates a project named vibecode with a default main branch.

Clone over SSH

Terminal window
git clone ssh://admin@localhost:29418/vibecode

Install the commit-msg hook

Gerrit identifies a change by a Change-Id line in the commit message. The commit-msg hook adds it for you.

Terminal window
curl -Lo `git rev-parse --git-dir`/hooks/commit-msg http://localhost:8080/tools/hooks/commit-msg && chmod +x `git rev-parse --git-dir`/hooks/commit-msg

Push a commit for review

The magic refspec is refs/for/main - it routes the push into a review instead of straight onto the branch.

Terminal window
git push origin main:refs/for/main

Feed the review back to the agent

Query a change and its comments over SSH, then hand the output to your coding agent and let it work out the improvements on its own.

Terminal window
ssh -p 29418 admin@localhost gerrit query --comments --current-patch-set 27eac4ed28b66d45e0ad30e795dda14ba70925d3

That last step is the whole point: the review becomes structured text an agent can read and respond to. Gerrit was not the unlock I hoped for, but the review-as-text-the-agent-consumes idea is worth keeping around regardless of the tool underneath.