Hacker News AI · 2026/10/18 12:33:49

Sphinx 发布 Git 钩子,强制开发者理解 AI 代码后推送

原标题:Show HN: Sphinx – a hook that quizzes you on your AI's code before shipping
68AI 研判分
核心综述

开源工具 Sphinx 推出基于 Git 钩子的“理解性检查”机制,在代码推送前通过提问迫使开发者解释 AI 生成代码的逻辑。该工具旨在解决“外包思考但不外包理解”的开发痛点,支持接入现有编码代理或 OpenAI 兼容端点,以极低 Token 消耗实现交互式验证。

报道全文原始报道全文

本文目录4 个章节

“Outsource your thinking, not your understanding.”

— Sun Tzu

Sphinx is a Git hook for agent-assisted development. Before your agent’s code ships, it asks you a question about what that code actually does.

$ npm install -g sphinx-understand

Built to run on minimal tokens, from your existing coding agent, OpenRouter, or any OpenAI-compatible endpoint.

$ git push origin mainsphinx · understanding check for main11 files changed · +5,012 −3,147

Sphinx

Your webhook handler now saves the event ID before calling charge(). Stripe times out and sends the same event again. What happens on the retry?

You

It runs twice, so the customer is charged twice.

Sphinx

You

It skips the charge, so the customer is never billed.

✓ Understood. Pushing to origin/main.

An illustrative exchange. Real questions come from your diff.

  1. 01

You push.

Or your agent does. Git pauses on the branches you protect. 2. 02

Sphinx asks.

A reviewer that never saw your chat reads the diff and asks what the change does when things go wrong. 3. 03

You answer.

Get it wrong and you learn why, then try a new scenario. Get it right and the push continues.

Works with Codex, Claude Code, Cursor, OpenCode, and Pi, or plain Git. Your answers never reach the coding agent, and .env files and keys are never opened. In a hurry? sphinx yolo lets pushes through, and every skip is logged.

Start in a minute.

文本
# Node 22.19+ · macOS, Linux, or WSL
npm install -g sphinx-understand
sphinx install

# then push as usual
git push

sphinx install connects Git and your coding agents and asks which model should review. Read the docs for everything else.


作者发帖说明(HN):

FOSS, Basically it plugs into your existing coding agent workflow and every time you push to prod it'll throw up a questionnaire that checks if you understand how the code you're pushing works.