HeadlinesBriefing HeadlinesBriefing.com

Sphinx Hook Quizzes AI Code Before Shipping

Hacker News •
×

Sphinx is a free, open-source Git hook designed for agent-assisted development workflows. Before code ships, it asks you a question about what the code actually does, ensuring understanding before deployment.

Created under the principle "Outsource your thinking, not your understanding," Sphinx integrates with existing coding agents and runs on minimal tokens. It works with Codex, Claude Code, Cursor, Open Code, and Pi, or plain Git. The tool never sends answers to the coding agent, and .env files and keys are never opened.

An illustrative exchange shows Sphinx asking about a webhook handler that saves an event ID before calling charge(). When Stripe retries the event due to timeout, the saved ID prevents a double charge. If charge() fails, the next retry skips billing, ensuring the customer is never billed.

Installation requires Node 22.19+ on macOS, Linux, or WSL. Run `npm install -g sphinx-understand` followed by `sphinx install`, then push as usual. In a hurry? `sphinx yolo` lets pushes through, with every skip logged. Sphinx connects Git and coding agents, asking which model should review the diff.

Source: Hacker News · Summarized by HeadlinesBriefing