Show HN: Sphinx – A hook that quizzes you on your AI's code before shipping
Sphinx: The Guardrail for AI-Assisted Coding
"You can outsource your thinking, but not your understanding." — Sun Tzu
Sphinx is a specialized Git hook designed for the era of agent-assisted development. It ensures that while an AI might write the code, the human developer remains the one who actually comprehends it.
🧠 The Core Philosophy
In a world of autonomous agents, it is easy to blindly trust the output blindly merge changes. Sphinx prevents this by forcing a "comprehension check" before any code is shipped.
The Workflow Logic
The process can be visualized as follows:
🛠️ Technical Implementation
To get started, you need a modern environment:
- Runtime:
Node 22.19+ - OS: macOS, Linux, or WSL
Installation Checklist
- Install the package globally
- Initialize the hook in your repo
- Perform a test push
Commands:
# Install the CLI tool
npm install -g sphinx-understand
# Link Git with your AI agents and select your review model
sphinx install
Once configured, your standard workflow remains unchanged:
git push Sphinx Review Success.
🔍 Example Scenario
Imagine you are pushing a change to a webhook handler.
The Diff:
11 files changed · +5,012 −3,147
The Sphinx Interaction:
sphinx · understanding check for main
"Your webhook handler now saves the event ID before calling charge().
The retry finds the saved ID and returns 200 without charging."
Sphinx acts as a reviewer who has never seen your chat history. It reads the raw diff and asks you to explain the logic—specifically how the system handles failures—ensuring you aren't just shipping "magic" code.
⚙️ Compatibility & Specs
Sphinx is designed to be lightweight and flexible, utilizing minimal tokens.
| Feature | Supported Options |
|---|---|
| AI Agents | Codex, Claude Code, Cursor, OpenCode, Pi, or standard Git |
| Endpoints | OpenRouter, OpenAI-compatible APIs, or your existing agent |
| License | Free / FOSS |
The "Understanding" Equation:
🔒 Privacy and Security
Sphinx is built with a "security-first" mindset:
- Isolation: Your responses to the quizzes never get sent back to the coding agent.
- Secret Protection: The tool is programmed to never open or read
.envfiles or private keys.
It is a tool for verification, not for data collection.