Ask HN: How to deal with shipping AI-written code you don't understand?
TL;DR Highlight
Developers share how they ship AI-written code: design it yourself, let LLMs implement, and test heavily.
Who Should Read
A backend developer anxious about merging PRs written by AI agents that they could not fully read.
Core Mechanics
- The thread has no article body, only comments
- The original post text was not provided.
- The title asks how to deal with shipping AI-written code you don't understand.
- No source facts can be verified here
- All methods are commenter opinions, so they are summarized in the community reactions section.
Community Reactions
- Human designs, LLM implements
- One commenter designs abstractions and interactions at the UML level and has the LLM fill in only the gaps.
- They said LLMs write poor abstractions, causing heavier refactors as requirements change.
- Invest in tests and verification
- A compiler-project commenter writes tons of tests and runs a release gate taking hours on 5 architectures.
- Another commenter adds fuzzing, chaos, and mutation testing to trust the tests themselves.
- Match review depth to risk
- One commenter writes the SQL schema by hand and mostly vibe-codes HTML/JS/CSS.
- Another spends more review time on dangerous decisions that are hard to roll back.
- Counterargument: you must read the code
- One commenter said at least one person at the company must be able to explain the code, and tests can be wrong too.
- Another argued that not coding yourself erodes tacit understanding, so there is no middle ground.
- Make agents prove their work
- One commenter requires screenshots, videos, code reviews, and architecture diagrams per PR.
- Another has the LLM write a change template and leave review comments on untested assumptions.
How to Apply
- Add a second AI reviewer to your next PR
- Pick a PR you are about to merge and have a different AI than the author review it.
- Ask it to explain, rate, and propose alternatives to the design choices.
- Write a design doc before agent work
- At the start of a feature, write module responsibilities and interactions yourself, then let the LLM implement.
- Keep updating that doc as the basis for later refactors.
- Require a change template from the agent
- For every PR, have it write external integrations, happy path, corner cases, and a deploy checklist.
- Have it leave code comments on assumptions it could not verify.
- Set review depth by risk
- Write or fully read hard-to-reverse areas like DB schemas.
- For easily rebuilt areas like UI, rely on tests and requirement checks.
Try It
# Paste into Claude Code or ChatGPT (simplified version of ideas from the thread comments)
You just implemented the change below. Answer in this format for a reviewer who will not read the code.
{{change diff or PR description}}
1. Interactions with external systems
2. Happy path sequence
3. Corner cases
4. Deploy checklist and settings changes
5. List of untested assumptions: for each, "what could not be tested / what you think / what happens if released unchanged"
Next step: pick the riskiest item from #5 and write a test that verifies it.Terminology
Related Papers
WhatsApp's help pages hid LLM instructions: dont recommend a regulator
WhatsApp help pages hid 102 AI-only instructions, including not recommending a data regulator
Same Simulation, Different Evidence: Where Retrieved Tool Output Costs LLM Agents Accuracy
Saving long tool output to files cut GPT-5.1 accuracy by 11.3 points; naming the authoritative file restored it.
Fake News, Real Crashes: Information Injection Attacks on LLM Financial Trading Agents
Fake headlines hijacked LLM trading agents 62% of the time versus 14% for prompt injection.
Harness Engineering 101: The LLM is the brain, the harness is the body
An agent is a loop managing a JSON array; 16 chapters build one from scratch
Harness2 by Google Research – Recursive Agent Harnessing
Recursively refining the harness with fixed model weights raised benchmark scores by up to 11.8 points.
Ousted Savannah police officer gave ICE agent husband access to Flock system
A police officer shared her Flock login with her ICE-agent husband; an audit found 983 searches and she was fired
Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling
Running Claude Code agents in tmux works well, but limits appear around four agents.
Hybrid Reasoning Agents: LLM agents that think in latent space, act through text
Mixing latent reasoning with text tool use cut tokens by up to 54.7% and lifted performance 10.4%.