Show HN: Sphinx – A hook that quizzes you on your AI's code before shipping
TL;DR Highlight
A Git hook quizzes you on your AI-written diff before push and lets it through only if you understand it.
Who Should Read
A developer who worries about pushing coding-agent output without really reading or understanding it
Core Mechanics
- It asks a question right before push
- Sphinx is a Git hook for agent-assisted development.
- Before the code ships, it asks what the code actually does.
- Questions come from the diff
- A reviewer model that never saw your chat reads only the diff.
- It asks what the change does when things go wrong.
- Wrong answers get an explanation and a new scenario
- A correct answer lets the push continue.
- The example was a Stripe webhook retry where charge() fails.
- It works across models and agents
- It runs on your existing coding agent, OpenRouter, or any OpenAI-compatible endpoint.
- It works with Codex, Claude Code, Cursor, OpenCode, Pi, or plain Git.
- It has privacy and bypass controls
- Answers never reach the coding agent, and .env files and keys are never opened.
Community Reactions
- Writing PR descriptions gives a similar benefit, per one commenter
- Splitting it into why, what, and how surfaced hidden LLM decisions and bugs.
- Someone built a quiz skill and found it useful
- They quizzed on the whole PR or branch rather than a commit, and the questions were good.
- Another said it helps on 1500-line PRs but misses bad decisions like calling the wrong endpoint.
- Opinion that it should run before code is written
- A commenter who built something similar said multiple choice lets people guess without understanding.
- Someone built one and quit using it
- They disliked being questioned by a tool expected to work like magic.
- Another predicted confirmation fatigue and agents answering for us.
- Opinion that it should gate PR submission
- It would save other people's time before they review.
- Others thought it would be great for OSS maintainers.
How to Apply
- Get quizzed on your current branch today
- Paste the prompt below into Claude or Claude Code with your diff.
- Check whether the question quality is useful before installing.
- Gate only protected-branch pushes with Sphinx
- Run npm install -g sphinx-understand, then sphinx install.
- Pick the reviewer model and push to main to see the flow.
- Make a self-quiz before opening a PR a team rule
- Add why, what, and how sections to your PR template.
- Require the how section to be written by the author without LLM help.
Try It
# Paste into Claude or Claude Code (simplified version of Sphinx's approach)
You are a code reviewer who never saw this conversation. Read only the diff below and quiz me.
Rules:
- Ask one question at a time.
- Ask about failure, retry, and edge cases, not the happy path.
- After I answer, judge it; if wrong, explain why and ask a new scenario.
- After 3 correct answers in a row, say "Understood".
{{git diff output}}
Next to try: answer wrong on purpose and check whether the explanation makes sense.Terminology
Related Papers
Same Simulation, Different Evidence: Where Retrieved Tool Output Costs LLM Agents Accuracy
Saving long tool output to files cut GPT-5.1 accuracy by 11.3 points; naming the authoritative file restored it.
Fake News, Real Crashes: Information Injection Attacks on LLM Financial Trading Agents
Fake headlines hijacked LLM trading agents 62% of the time versus 14% for prompt injection.
Harness Engineering 101: The LLM is the brain, the harness is the body
An agent is a loop managing a JSON array; 16 chapters build one from scratch
Harness2 by Google Research – Recursive Agent Harnessing
Recursively refining the harness with fixed model weights raised benchmark scores by up to 11.8 points.
Ousted Savannah police officer gave ICE agent husband access to Flock system
A police officer shared her Flock login with her ICE-agent husband; an audit found 983 searches and she was fired
Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling
Running Claude Code agents in tmux works well, but limits appear around four agents.