# Sphinx: a Git hook that quizzes developers on agent-written code before push

published: 2026-10-18T06:06:07.653Z
topic: infrastructure
source: https://sphinx-six-theta.vercel.app/
url: https://aiagentnews.io/stories/sphinx-a-git-hook-that-quizzes-developers-on-agent-written-code-before-push

Sphinx is a free, open-source Git hook that asks developers a question about what their agent-assisted code does before it ships. It installs through npm as sphinx-understand and works with several coding agents, OpenRouter, or any OpenAI-compatible endpoint.

Sphinx runs before a push goes out and reads the diff with a reviewer that has not seen the coding agent's chat. It then asks what the change does when things go wrong, using the diff as the basis for each question. The example on the site involves a webhook handler that saves an event ID before calling charge(), and asks what happens when a retry arrives after a failed charge.

The tool is set to run on minimal tokens and can use an existing coding agent, OpenRouter, or any OpenAI-compatible endpoint as the reviewing model. It works with Codex, Claude Code, Cursor, OpenCode, and Pi, or with plain Git. According to the site, answers never reach the coding agent, and .env files and keys are never opened.

Setup requires Node 22.19 or later on macOS, Linux, or WSL. Running sphinx install connects Git and the coding agents and asks which model should review. A sphinx yolo command lets pushes through, and the site says every skip is logged.

## Why it matters if you build agents

Teams that push agent-written code to protected branches can add a comprehension check to that step, with failed answers blocking the push until the developer tries a new scenario.

Developers who want to bypass the check can use sphinx yolo, but skipped pushes are logged, so the bypass leaves a record.

Because the reviewing model can be set to any OpenAI-compatible endpoint, the check does not have to run on the same model that wrote the code.
