Dispatches · News update

Sphinx quizzes you on AI-written code before you push

By Kalpak Kale ·

Close-up of a glowing laptop keypad with digital interface, representing futuristic technology.
Photo by Rafael Minguet Delgado on Pexels

News update: this post was researched and drafted automatically from the sources listed at the end, and published without a human edit. If you spot a mistake, write to me and I will fix it.

A new open-source tool called Sphinx appeared on Hacker News this week. It is a Git hook for agent-assisted development. Before your agent's code ships, Sphinx asks you a question about what that code actually does. You answer. If you get it right, the push continues. If you get it wrong, you learn why.

The Show HN page includes a sample exchange. Sphinx asks about a Stripe webhook handler that saves an event ID before calling charge(). The user says the retry charges the customer twice. Sphinx corrects that, explains the idempotency logic, and asks a follow-up. This is not a syntax check. It is a check on understanding.

In one line: Sphinx adds a pre-deployment questionnaire to coding agent workflows, so you have to explain what the AI wrote before it reaches your repository.

What Sphinx does

Sphinx installs as a global npm package. The command is npm install -g sphinx-understand, then sphinx install. It connects Git and your coding agents, and you pick which model reviews your diffs. It runs on minimal tokens, using your existing coding agent, OpenRouter, or any OpenAI-compatible endpoint.

Here is how it works:

  • You push, or your agent does. Git pauses on the branches you protect.
  • Sphinx reads the diff and asks what the change does when things go wrong.
  • You answer. Get it wrong and you learn why, then try a new scenario. Get it right and the push continues.

It works with Codex, Claude Code, Cursor, OpenCode, and Pi, or plain Git. Your answers never reach the coding agent. The tool says .env files and keys are never opened. If you are in a hurry, sphinx yolo lets pushes through, and every skip is logged.

Why this matters for agentic coding

The risk with agentic coding is not just wrong code. It is code that works but that the developer does not understand. When a client asks why a webhook retry does not charge twice, you need to explain the logic. If you cannot, you are shipping on faith.

Sphinx forces a moment of explanation before code leaves your machine. That is different from a linter or a test suite. It targets the developer's mental model, not just the code's correctness. For a small team, this could catch mistakes that automated checks miss. The sample on the Show HN page is a good example. A webhook handler that stores an ID before a charge call has a subtle failure mode. Misunderstanding it could lead to duplicate charges or missed charges. Sphinx quizzes on that exact edge case.

This touches the same gap I wrote about in A brief goes in, software comes out: process is what makes agentic coding safe. A hook like Sphinx could be part of that process.

What Sphinx does not do

Sphinx does not check if the code actually runs. It does not run tests or static analysis. It does not replace human review. It does not teach you the code on its own, you must answer in your own words. The quality of the questions depends on the model you point it to. And this is early software. The Show HN page is a landing page, not a peer reviewed evaluation. The code is open source, so you can inspect it, but I have not yet run it on a real project.

A practical take for my work

I would try Sphinx on a small internal project first. Something like a RAG chatbot prototype where I am the only developer and the code is mostly agent generated. I want to see if the questions match the parts of the diff I am unsure about. For client work, I would be cautious. Adding a hook to a client's protected branch could slow down delivery. But I could use it on a staging branch or a personal fork to build the habit. If it proves useful, I would pair it with a short review checklist.

The key metric is not how many questions I answer correctly. It is how often Sphinx makes me realise I did not understand a change. That is worth logging. Also, sphinx yolo is a useful escape hatch, but I would review the skip log weekly. For now, this is a watch and try tool, not a standard part of our delivery process.

Sources