Contents7 sections
- What goes wrong when you ship code you don't understand
- What "understanding" actually means for a code change
- A five-step AI generated code review before deploying
- Where quiz hooks like Sphinx fit, and where they don't
- Setting a shipping standard for yourself or your team
- Frequently asked questions
- Sources and references
Shipping AI-written code you cannot explain is a bet that nothing will go wrong. When it does, someone has to debug it, and accountability sits with the developer who approved the change, not with the model. A good AI generated code review before deploying therefore asks a narrower question than "does it run?": can you describe what this change does, and what it does when things fail? As of October 2026, this guide draws on Anthropic's published research, the OWASP Secure Coding with AI cheat sheet and the documentation for Sphinx, a comprehension-check Git hook that appeared on Hacker News as a Show HN that month. It is written for individual developers and small teams using AI coding assistants or agents, regardless of language or employer policy.
What goes wrong when you ship code you don't understand
Debugging is the first casualty. In a randomized controlled trial published by Anthropic in January 2026, 52 mostly junior engineers built features with Trio, an asynchronous Python library none of them had used. The AI-assisted group averaged 50% on a quiz taken minutes later, compared with 67% for the group coding by hand; the researchers describe this as a 17% lower score. The widest gap was on debugging questions. The AI group finished about two minutes faster on average, but that difference was not statistically significant.
The study has clear limits, and its authors state them: a small sample, a quiz measured immediately after the task, and no evidence about long-term skill. Participants used a sidebar chat assistant rather than an agent, and a footnote notes that agentic products like Claude Code may have more pronounced effects. Still, the deployment lesson is plain. If the skill that weakens most is spotting why code is wrong, then code you never understood becomes most expensive exactly when it fails in production.
Security and accountability
The OWASP Secure Coding with AI cheat sheet says every AI-assisted change needs a human owner and explicit approval that signals the developer reviewed and understood it. It is blunt that "the AI wrote it" does not shift responsibility, and that AI review comments are not a substitute for human review. It also lists risks particular to AI coding: hallucinated package names that attackers can register, suggested dependency versions with known CVEs, and edits outside the requested scope. Without understanding the change, these are easy to miss.
What "understanding" actually means for a code change
Understanding is not memorizing lines. Anthropic's study grouped mastery into debugging, code reading, code writing and conceptual questions, and treated debugging, reading and concepts as the skills that matter most for overseeing AI-written code. Sphinx takes a similar view: its questions target behavior, failure modes and invariants rather than file or function names. Use the prompts below on your own diff.
Behavior
- Question to ask yourself
- What does this change do differently from before?
- Risk if you can't answer
- Unintended feature changes slip through
Failure modes
- Question to ask yourself
- What happens on a timeout, retry or duplicate request?
- Risk if you can't answer
- Double processing or silent drops
Invariants
- Question to ask yourself
- Which rule must never break, and where is it enforced?
- Risk if you can't answer
- Data integrity erodes quietly
Scope
- Question to ask yourself
- Did any unrequested files or config change?
- Risk if you can't answer
- CI or dependency edits ship unreviewed
Rollback
- Question to ask yourself
- How would you revert this if it misbehaves?
- Risk if you can't answer
- Longer incidents
The example on the Sphinx site is a useful benchmark. A webhook handler now saves the event ID before calling the charge function, and the payment provider times out and resends the same event. Many people answer that the customer gets charged twice. In fact the retry finds the saved ID and returns success without charging. The real bug is the opposite: because the ID is stored before the charge succeeds, a failed charge means the next retry skips billing entirely. Being able to reason about that kind of failure path is what understanding looks like.
A five-step AI generated code review before deploying

- 1
Read the full diff, not the summary
Do not approve from a PR description or an agent's recap. OWASP calls out-of-scope edits such as lockfiles, CI configuration and unrelated tests the most common review failure in agentic coding. Scan every changed file and ask why any unexpected one is there.
- 2
Explain it without the AI's words
Write two or three sentences on the purpose, inputs and outputs, and main branches. Wherever you stall is what you don't yet understand. Asking the AI a conceptual question about that spot is fine, but restate the answer yourself afterward.
- 3
Predict at least one failure
Pick a timeout, retry, duplicate request, empty value, unauthorized user or concurrent run. Predict how the code reacts, then read the code to confirm. A wrong prediction marks a place to fix or test before shipping.
- 4
Audit the tests separately
Look for deleted tests, weakened assertions and new mocks that replace real dependencies. If one agent wrote both code and tests, add at least one failure case it did not generate, such as malformed input, a boundary value or an expired token.
- 5
Check dependencies, build files and ownership
Confirm new packages actually exist on the registry and run your audit tool for known vulnerabilities. Treat changes to package.json scripts, GitHub Actions workflows and Dockerfiles as security-sensitive. Finally, record who owns and approved the change.
You do not need full intensity every time. A copy or styling change may only need steps one and two. Changes to authentication, payments, personal data or deployment settings deserve all five and, ideally, a second reviewer. Whatever you skip, you should be able to say why skipping it was reasonable.
Where quiz hooks like Sphinx fit, and where they don't
Sphinx is an MIT-licensed open-source Git hook. When you push to a protected branch, Git waits while a separate reviewer model, which never sees the chat that produced the code, reads the committed change through read-only Git tools and asks you to predict what it does. Miss something and you get an explanation plus a fresh scenario; pass and the same push continues. It behaves the same whether you or an agent runs git push, integrates with Claude Code, Codex, Cursor, OpenCode and Pi, and is open-book, so you can read the code while answering.
The README lists practical conditions. It needs Node.js 22.19 or newer on macOS, Linux or WSL; native Windows is not supported yet. Installation sets your global Git core.hooksPath, so pushes to main or master in every repository on the machine are checked by default. A matching push waits up to 25 minutes for you to pass, pause or skip. At the default depth, small changes get at most one question and large ones up to three, and a pass lasts 24 hours unless the code, destination or policy changes.
Checks
- Quiz hook (Sphinx)
- The pusher's comprehension
- Human code review
- Design, correctness, maintainability
- Tests and scanners
- Defined rules and known flaws
Strength
- Quiz hook (Sphinx)
- Forces failure-mode thinking at push time
- Human code review
- Brings context and team norms
- Tests and scanners
- Fast and repeatable
Limit
- Quiz hook (Sphinx)
- Bypassable; the examiner can be wrong
- Human code review
- Fatigue on large diffs
- Tests and scanners
- Misses logic outside the rules
Replaces the others?
- Quiz hook (Sphinx)
- No
- Human code review
- No
- Tests and scanners
- No
Sphinx's own README says it is practice, not a security gate. Anyone with local access, including a coding agent, can bypass hooks, and a pass does not prove you understood the change unaided. Version 0.1 covers local commits and pushes only, not web merges, CI-required checks or deployments.
Mind the cost and data flow too. Sphinx has no account or hosted service; it uses a signed-in Codex or Claude Code plan, an OpenRouter key or any OpenAI-compatible endpoint. That provider receives the changed code, related files, your answers and the project context file. .env files, private keys and common credential files are excluded by default, but the rules match paths, so a secret pasted into ordinary source is not caught. There is no default cap on model calls; a typical check makes about 5 to 8 requests plus roughly one per answer, so set spending limits on paid providers. Skips via sphinx yolo are logged with their reason.
Setting a shipping standard for yourself or your team
Decide the standard before picking a tool. A team might write down that AI-written changes still need a human approver, that CI, auth and payment files get a second reviewer, and that any deleted test needs a stated reason. Whether a quiz hook should be a hard gate or an optional aid depends on culture; the Hacker News discussion split between people who saw it as a brake on colleagues dumping unread AI code and people who expected confirmation fatigue, or agents answering on the developer's behalf.
Solo developers can start by changing how they use AI. In Anthropic's study, the higher-scoring patterns were generating code and then asking follow-up questions, requesting code together with explanations, or asking only conceptual questions and writing the code themselves. Fully delegating generation or debugging averaged below 40%. AI coding tools and agent incidents change quickly, so it helps to follow what practitioners are discussing in theddari's AI Telegram trends and blog trends when you revisit your checklist.
Before you hit deploy, answer three questions honestly. Can you explain in your own words what this change does? Can you predict how it behaves in at least one failure case? Have you personally checked the test and dependency changes? If any answer is no, the code is not ready yet. A quiz hook can turn those questions into a habit, but answering them and owning the result remains the job of whoever ships it.



