Show HN: Sphinx – a hook that quizzes you on your AI's code before shipping
Sphinx, a free Git hook, quizzes developers on agent-written diffs and blocks pushes until they answer correctly.
Sphinx is a free open-source Git hook for agent-assisted development. Before code is pushed to a protected branch, it reads the diff and asks what the change does when things fail; a correct answer allows the push. It can run through the existing coding agent, OpenRouter, or any OpenAI-compatible endpoint, and supports Codex, Claude Code, Cursor, OpenCode, and Pi. Answers are not returned to the coding agent, .env files and keys are not opened, and sphinx yolo can bypass the check with the skip logged.
- Free npm package sphinx-understand installs a Git hook on Node 22.19+.
- Protected-branch pushes pause until the author correctly explains the diff.
- Works with Codex, Claude Code, Cursor, OpenCode, Pi, or plain Git.
- Uses the existing agent, OpenRouter, or an OpenAI-compatible endpoint.
- Answers and .env secrets stay local; sphinx yolo skips are logged.
Full article312 words · extracted from sphinx-six-theta.vercel.app · click to collapse
- Free
- FOSS
“Outsource your thinking,
not your understanding.”
— Sun Tzu
Sphinx is a Git hook for agent-assisted development. Before your agent’s code ships, it asks you a question about what that code actually does.
npm install -g sphinx-understand
Built to run on minimal tokens, from your existing coding agent, OpenRouter, or any OpenAI-compatible endpoint.
$ git push origin main
sphinx · understanding check for main
11 files changed · +5,012 −3,147
Sphinx
Your webhook handler now saves the event ID before calling charge(). Stripe times out and sends the same event again. What happens on the retry?
You
It runs twice, so the customer is charged twice.
Sphinx
Not quite. The retry finds the saved ID and returns 200 without charging. But that ID is stored before the charge succeeds. If charge() fails, what does the next retry do?
You
It skips the charge, so the customer is never billed.
✓ Understood. Pushing to origin/main.
An illustrative exchange. Real questions come from your diff.
- 01
You push.
Or your agent does. Git pauses on the branches you protect.
- 02
Sphinx asks.
A reviewer that never saw your chat reads the diff and asks what the change does when things go wrong.
- 03
You answer.
Get it wrong and you learn why, then try a new scenario. Get it right and the push continues.
Works with Codex, Claude Code, Cursor, OpenCode, and Pi, or plain Git. Your answers never reach the coding agent, and .env files and keys are never opened. In a hurry? sphinx yolo lets pushes through, and every skip is logged.
Start in a minute.
# Node 22.19+ · macOS, Linux, or WSL
npm install -g sphinx-understand
sphinx install
# then push as usual
git pushsphinx install connects Git and your coding agents and asks which model should review. Read the docs for everything else.
Text extracted automatically; images, tables and formatting may be missing. Original: https://sphinx-six-theta.vercel.app/