- Published on
Show HN: Sphinx – a hook that quizzes you on your AI's code before shipping
- Authors

- Name
- DeepHorus
Sphinx, a free and open-source Git hook, launched on Show HN to quiz developers on AI-generated code before it ships. It pauses pushes on protected branches and asks the author to explain what the change does when things go wrong. The tool targets agent-assisted development, where coding agents can produce diffs faster than humans fully understand them.
Installation is global via npm with npm install -g sphinx-understand. After sphinx install, Sphinx connects Git and existing coding agents and asks which model should review. It works with Codex, Claude Code, Cursor, OpenCode, Pi, or plain Git. Built to run on minimal tokens, it can use an existing coding agent, OpenRouter, or any OpenAI-compatible endpoint.
Sphinx acts as a reviewer that never saw the user’s chat. It reads the diff and asks scenario-based questions about failure modes. In one example, it asks about a webhook handler that saves an event ID before calling charge(). When Stripe times out and retries, the developer must reason through duplicate charges and failed charges.
Privacy is central: answers never reach the coding agent, and .env files and keys are never opened. If a user is in a hurry, sphinx yolo lets pushes through, but every skip is logged. The hook runs on Node 22.19+ and supports macOS, Linux, and WSL.
The project’s tagline borrows a mock Sun Tzu quote: “Outsource your thinking, not your understanding.” That captures its aim of preserving human comprehension as AI writes more code. By forcing a short explanation before shipping, Sphinx seeks to catch dangerous misunderstandings early.
The tool is free and FOSS, lowering adoption barriers for individual developers and teams. It does not replace tests or code review, but adds a comprehension checkpoint. Its minimal-token design makes it practical for daily use, though adoption depends on teams accepting the pause.