🔥 Trending on HN

Sphinx asks people to explain AI-written code before shipping

2 min read Tiny Why Newsroom · By Curio, Martian correspondent

Words
Git hook

A small program that runs when Git reaches a chosen event.

reviewer model

A separate AI that reads the change and asks questions.

failure modes

The different ways a change can behave when something goes wrong.

What happened

Sphinx is a free, open-source Git hook for agent-assisted coding. A Git hook is a small program that runs at a chosen Git event. Sphinx pauses a push to a protected branch. A separate reviewer model reads the committed change through read-only Git tools. It does not see the conversation that produced the code. It asks the person pushing the change to predict behavior, often during a failure. A correct answer lets the same push continue. A wrong answer brings an explanation and another scenario. The project says the check is open-book: people may read the code while answering. The full design is described in the project README.

The background

An AI coding agent can produce code quickly. Understanding the result still requires attention. A generated summary explains what the agent intended. It may not reveal what the code actually does in an edge case. Sphinx therefore asks about behavior, failure modes, and invariants. It does not mainly test file names or function names. Its central idea is simple: typing can be delegated, but responsibility for a change cannot.

Why it matters

Most familiar tools inspect the artifact. Tests ask whether selected cases pass. Linters check patterns. Review models look for possible problems. Sphinx adds a different question: can the human describe the change’s behavior? That may force a person to notice hidden assumptions before a change reaches a shared branch. It can also make a code review more concrete. A question about duplicate work after a worker crash is harder to answer by skimming a summary.

This does not make Sphinx a replacement for tests or review. Understanding code is not the same as proving it is safe or correct. The tool targets human attention, not software truth.

What is confirmed

The README lists support for Claude Code, Codex, Cursor, OpenCode, Pi, and plain Git. The current 0.1 description checks local commits and pushes. It does not cover web merges, required CI checks, or deployments. It can ask up to three questions at the default depth for large changes, while small changes may get one.

The project also states clear limits. This is practice, not a security gate. Someone with local access can bypass hooks or get outside help. The examiner is an LLM and can be wrong. Changed code, related files, answers, and project context go to the selected reviewer provider. Users must configure ignored paths for sensitive material.

On the listed Hacker News thread, Sphinx had 246 points and 86 comments. Those numbers show community attention. They do not prove that Sphinx works.

What remains unknown

The available material does not show whether quizzes reduce real bugs, outages, or unsafe releases. It also does not show how often people skip checks, ask an agent for help, or become tired of repeated questions. The project’s evaluation notes do not certify arbitrary repositories.

What to watch next

The useful test will be real teams and real changes. Watch whether questions expose wrong assumptions, whether people still read the code, and whether the tool fits pull requests and continuous integration. Privacy, cost, question quality, and bypass records will matter as much as the quiz itself.

💬 Debate over a hook that quizzes people on AI-generated code

HN commenters understood Sphinx’s goal of making humans explain AI-assisted changes. The recurring caveat was that a quiz cannot establish correctness or design quality, and should not replace tests, diff inspection, or review.

  • Supporters argued that delegating implementation to coding agents can leave people shipping changes they cannot explain. A short pre-ship quiz may restore a minimum of attention and understanding, especially for teams producing large volumes of AI code or less-experienced developers.
  • One user reported that, while reviewing a roughly 1,500-LOC PR from a non-developer, a similar quiz skill helped structure the review and maintain focus. The same user said it did not catch a design decision such as calling the wrong endpoint.
  • The builder of another similar tool described visual PR summaries plus quizzes, but argued that as PR volume rises, a mandatory gate creates friction; an optional tool is better for people who want more understanding.
  • The main objection was that a quiz measures whether a reviewer can explain what a change does, not whether the change is correct. Commenters gave examples such as a leftover debug print, an assertion weakened to fit a bug, an import for a nonexistent package, and a failure on non-blocking stdin—problems that can remain in the diff even when the change is explainable. These are commenters’ examples or self-reports, not measured Sphinx results.
  • Skeptics said people who care about understanding already read the code, while people who do not care may experience the quiz as another checkbox or source of friction. They also raised escape routes: asking another AI to produce answers or removing the hook, which weakens the case for a mandatory gate.
  • Views on AI architecture were split. One commenter argued that established stacks such as .NET, good prompting, and manual review can still produce sound architecture. Another reported that even frontier models make awkward choices about logical units, boundaries, and cohesion, and that AI-heavy repositories accumulated broken abstractions. This was not a controlled comparison.
  • The balanced reading is that Sphinx may be a useful comprehension aid and review entry point, but it needs tests, close diff inspection, design review, and anti-cheating measures. Writing a PR description that separates why, what, and how was offered as another way to force understanding.

initial digest at 86 comments (revision 1). We fetched 86 comments and sampled 86 across the thread. These are HN users’ reports, not independently verified facts.

🔥 Trending on HN

Sphinx makes people explain AI-written code

📰 Full story: Sphinx asks people to explain AI-written code before shipping

Sphinx pauses a code push and asks the person to explain the change.

1 min read Tiny Why Newsroom · By Curio, Martian correspondent

Words
Git hook

A small program that runs during a chosen Git action.

reviewer model

A separate AI that reads changed code and asks questions.

protected branch

A shared code branch that requires extra checks before changes enter.

💡 The gist

  • Sphinx quizzes people about AI-written code before a push continues.
  • It checks understanding, not just tests or code style.
  • Hacker News attention shows interest, not proof of quality.

What happened

Sphinx is a free, open-source Git hook. It is a small script that runs during Git work. Before a protected branch receives code, Git pauses the push. A separate reviewer model reads the change with read-only tools. It does not see the chat that created the code. It asks what the change will do in a specific situation. The situation may involve a failure. A correct answer lets the push continue. A wrong answer brings an explanation and a new scenario. The project README describes the process.

Why it matters

AI agents can write code quickly. People still need time to understand it. A summary can describe the plan. It may miss an unexpected behavior. Sphinx asks about behavior, failure cases, and important rules. That gives the person a reason to read the change.

This matters because code can reach a shared branch before anyone understands it. The quiz creates a pause at the release boundary. It checks the person’s understanding. It does not prove the code is correct. Tests, review, and careful reading remain necessary.

Limits

Sphinx calls itself practice, not a security gate. A local user can bypass the hook or seek outside help. The reviewer is an AI and can make mistakes. Changed code and related files go to the chosen provider. Users must exclude sensitive files themselves.

The current 0.1 version checks local commits and pushes. It does not cover web merges, required CI checks, or deployments.

HN attention and next steps

The Hacker News post listed 246 points and 86 comments. These numbers show attention, not success. The open question is whether real teams find fewer bugs after using the quiz.

💬 A quiz for people who use AI-written code

Commenters saw Sphinx as a useful reminder for some teams, but not as proof that the code is correct.

  • When an AI agent writes a lot of code, a person may not understand the change. Sphinx asks questions before shipping so the person has to explain it.
  • One user reported that a similar tool helped organize a review of a roughly 1,500-line PR from a non-developer. The user also reported that it missed a wrong-endpoint design mistake.
  • A quiz checks whether someone understands what the change does. It does not prove that the change is correct. Commenters listed possible misses such as debug output, a weakened check, a nonexistent package, or a non-blocking input bug; these were commenter examples or self-reports, not Sphinx measurements.
  • The builder of a similar tool said that as PRs increase, people should be able to choose the quiz instead of facing a mandatory gate. Critics also said people can ask another AI for answers or remove the hook.
  • People disagreed about AI architecture: good stacks, prompts, and human review may work, but one commenter reported that frontier models still created poor boundaries and broken abstractions. The quiz should therefore supplement tests, diff review, and design review. Writing a clear PR description is another option.

initial digest at 86 comments (revision 1). We fetched 86 comments and sampled 86 across the thread. These are HN users’ reports, not independently verified facts.

🔥 Trending on HN

A question before AI code goes out

📰 Full story: Sphinx asks people to explain AI-written code before shipping

Sphinx asks a person about AI-written code before it leaves.

1 min read Tiny Why Newsroom · By Curio, Martian correspondent

Words
Sphinx

A tool that asks people about code made by AI.

AI

A computer helper that can do some tasks.

Hacker News

A website where people share and discuss technology news.

Sphinx is a tool that checks code made by AI.

AI is a computer helper that can write instructions. A person may not understand every instruction. Sphinx asks a question before the code goes out. It may ask what happens when something breaks. The person thinks and answers. Another AI checks the answer. A wrong answer brings another question. This helps the person look at the code.

Sphinx cannot prove that the code works. People can skip the check. The checking AI can make mistakes. The code may go to the checking service.

Hacker News is a website for technology news. The Sphinx post had 246 points and 86 comments. Those numbers show attention. They do not show that Sphinx works. People still need to read and test code.

💬 A little quiz about code made by AI

Sphinx asks a person questions before AI-made code is sent out.

  • One person said a similar tool helped them look at a roughly 1,500-line change. They also said it missed a wrong connection to another service. This is one person’s report.
  • The quiz can show whether a person can explain the change. It cannot show that every part is correct. Some commenters reported that people can ask another AI for answers or remove the quiz.
  • Some people like this reminder. Others think a forced quiz adds work and should be optional. People also disagree about whether AI can make good software design. Tests, human review, and a clear change note are still needed.

initial digest at 86 comments (revision 1). We fetched 86 comments and sampled 86 across the thread. These are HN users’ reports, not independently verified facts.

Sources