Featured image of post Sphinx open-sources Git hook, AI must answer comprehension questions correctly before pushing code

Sphinx open-sources Git hook, AI must answer comprehension questions correctly before pushing code

Sphinx open-sources Git hook: it asks questions about the diff before push, and won't let you push unless you answer correctly. Free FOSS, requires Node 22.19+, install sphinx-understand via npm and then run sphinx install to set it up. Compatible with Codex, Claude Code, Cursor, etc.; models can use the built-in proxy or any OpenAI-compatible endpoint. Answers are not sent back to the coding agent; sphinx yolo can skip it, but every skip is logged. Source: Hacker News

Answer Before You Push: Sphinx Wants to Add an Understanding Gate to AI Code

An open-source project called Sphinx has appeared on Hacker News. It turns itself into a Git hook (a small script Git triggers automatically before or after actions like push): before you or your coding agent pushes code to a protected branch, it asks you a question about the change.

Here are the hard details from the official site:

  • Price: Free, FOSS (open source)
  • Installation: npm install -g sphinx-understand, then run sphinx install to connect Git with your coding agent
  • Runtime: Node 22.19+, supports macOS, Linux, WSL
  • Compatible coding agents: Codex, Claude Code, Cursor, OpenCode, Pi, or plain Git
  • Review model source: Your existing coding agent, OpenRouter, or any OpenAI-compatible endpoint
  • Release date and version number: Not listed on the official page
  • Availability: The install command is provided, so you can try it immediately
  • Open source?: The project calls itself FOSS, but no repository URL is given on the page

Questions Grow Out of the Diff; Answers Don’t Flow Back to the Agent

The way questions are generated is very specific: a reviewer who “hasn’t seen your chat history” reads the diff for this push (the version difference, i.e., which lines changed), then asks, “What will this change do when things go wrong?”

The official demo shows a dialogue: the change makes the webhook handler save the event ID before calling charge(). Sphinx follows up: if Stripe times out and resends the same event, what happens on the retry? The answer “it will double-charge” is judged incorrect, and it tells you that the retry will read the saved ID, return 200, and not charge again. Immediately after, a second, even trickier question: if charge() fails, what happens on the next retry—the answer is that the charge is skipped, and the user never receives a bill. Only after this round does the push continue.

There are two clear privacy promises: your answers are not sent back to the coding agent; .env files and secrets are never opened.

The most intriguing thing here is a contrast: the change that gets questioned in the official demo touches 11 files, +5,012 / −3,147 lines—exactly the typical scene of “an agent writes thousands of lines in one go, and a human only scans them.” Yet this tool, whose selling point is “forcing you to understand,” has an escape hatch sitting among its first-class citizens: sphinx yolo lets the push go straight through, except that every skip is recorded. Incidentally, the official site attributes an English aphorism to “Sun Tzu”—a common internet joke; the product itself is quite serious.

On Hacker News, this Show HN post currently has 242 points and 85 comments.

Key Information at a Glance

DimensionDetails
Project typeFree, FOSS Git hook
Installationnpm install -g sphinx-understand, then run sphinx install
RuntimeNode 22.19+, macOS / Linux / WSL
Compatible agentsCodex, Claude Code, Cursor, OpenCode, Pi, or plain Git
Model sourceExisting coding agent, OpenRouter, any OpenAI-compatible endpoint
PrivacyAnswers are not sent back to the coding agent; .env and secrets are not opened
Skip methodsphinx yolo; every skip is recorded
Version / release dateNot provided on the official site

Who Should Use It, and Who Should Wait

Who it’s for: teams and individuals who routinely rely on agents to generate code in bulk and have protection rules set on production branches; when “what changed this time” becomes something you can’t even explain yourself, it’s a rope pulling you back to the diff. People who have just inherited an unfamiliar codebase and want to be forced to read through the changes can also benefit.

Who should wait: If the current changes are mostly dependency upgrades or configuration tweaks, or if you’re in the middle of a release window, skipping with sphinx yolo is a better trade-off than being stuck at the terminal answering questions. Also, the official site doesn’t list a version number, release date, or measured token consumption data; “minimal tokens” is currently just a claim. For teams that need to evaluate CI integration, audit log format, or compliance trails, the information on the current page isn’t enough to make a decision. It also requires someone to sit at the terminal answering questions, so it may not be suitable for fully automated, unattended pipelines.

Final Thoughts

AI coding has pushed the cost of “writing code” close to zero, but the cost of “understanding code” hasn’t fallen with it; instead, it has risen because there’s more output. Sphinx moves that cost back to before the push, which is the right direction; but whether one question can really stop “I don’t understand it, but I want to ship it” ultimately depends on whether teams are willing not to use yolo.