Show HN: Sphinx – A hook that quizzes you on your AI's code before shipping
FreeFOSS “You can outsource your thinking, but 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
Sphinx 是一个用于智能体辅助开发的 Git 钩子。在你的智能体代码发布之前,它会向你提问,确认你是否真正理解该代码的功能。 $ 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 main sphinx · understanding check for main 11 files changed · +5,012 −3,147
它旨在以极少的 Token 运行,支持你现有的编码智能体、OpenRouter 或任何兼容 OpenAI 的端点。 $ git push origin main sphinx · 正在对 main 分支进行理解检查 11 个文件已更改 · +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 你的 Webhook 处理程序现在会在调用 charge() 之前保存事件 ID。Stripe 超时并再次发送相同的事件。重试时会发生什么? You 它会运行两次,所以客户会被扣费两次。
Sphinx Not quite. The retry finds the saved ID and returns 200 without charging. But that ID is stored before the charge succeeds. If charge() fails, what does the next retry do? You It skips the charge, so the customer is never billed. ✓ Understood. Pushing to origin/main.
Sphinx 不完全对。重试会找到已保存的 ID 并返回 200,而不会再次扣费。但该 ID 是在扣费成功前保存的。如果 charge() 失败了,下一次重试会做什么? You 它会跳过扣费,所以客户永远不会被计费。 ✓ 理解正确。正在推送到 origin/main。
An illustrative exchange. Real questions come from your diff. 01 You push. Or your agent does. Git pauses on the branches you protect.
这是一个示例对话。真实的问题源自你的代码差异(diff)。 01 你推送代码。 或者由你的智能体推送。Git 会在你保护的分支上暂停。
02 Sphinx asks. A reviewer that never saw your chat reads the diff and asks what the change does when things go wrong.
02 Sphinx 提问。 一个从未看过你聊天记录的审查者会阅读差异内容,并询问当出现问题时,该变更会产生什么影响。
03 You answer. Get it wrong and you learn why, then try a new scenario. Get it right and the push continues.
03 你回答。 答错了,你会了解原因,然后尝试新的场景。答对了,推送继续进行。
The real questionnaire: a push waits, you answer, Git 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.
真正的问卷:推送等待,你回答,Git 继续。 它适用于 Codex、Claude Code、Cursor、OpenCode、Pi 或普通的 Git。你的回答永远不会发送给编码智能体,且 .env 文件和密钥绝不会被打开。赶时间?sphinx yolo 可以跳过检查直接推送,且每次跳过都会被记录。
Start in a minute.
Node 22.19+ · macOS, Linux, or WSL
npm install -g sphinx-understand sphinx install
then push as usual
git push
一分钟内即可开始。
Node 22.19+ · macOS, Linux, 或 WSL
npm install -g sphinx-understand sphinx install
然后像往常一样推送
git push
sphinx install connects Git and your coding agents and asks which model should review. Read the docs for everything else.
sphinx install 会连接 Git 和你的编码智能体,并询问应使用哪个模型进行审查。其他所有信息请阅读文档。