How to ship AI-written code you don't fully understand
You can ship AI-written code you haven't read line by line, as long as you understand and can check the product behaviour it's supposed to deliver. Read the parts with a big blast radius yourself, own the design, write down the intended behaviour before the agent codes, check it with tests the coding agent didn't grade for itself, and keep a named human signing off on each release. Moving your understanding up from lines of code to product behaviour is how you stay accountable for code you didn't type.
Why this question blew up on Hacker News
On 19 October an Ask HN thread quoted a Meta engineer saying the code he ships now "feels like a black box" and asking how much he needs to understand before he's comfortable moving on. It passed 600 points and 700 comments, so plenty of people feel the same.
The replies split into roughly two camps. One says you must read the code before shipping it, because "this is less a matter of quality and more a matter of responsibility." The other says engineers have always shipped code they didn't fully read: principal engineers and engineering managers have relied on testing, design docs and release management for years.
Both camps are right about something. Responsibility doesn't move to the agent. And reading every line of a 1,000-line agent diff every day doesn't scale. Here's the middle path the most useful replies point to.
1. Decide where you still read every line
Blast radius should decide how much you read. One commenter vibe codes the UI freely but still writes the SQL schema entirely by hand, because getting that wrong "tends to be far more catastrophic." Another puts it plainly: a stateless frontend needs little more than a visual check, while payments or client-server security deserve a real audit.
Make that list explicit for your codebase. Data migrations, auth, money movement, permissions and anything irreversible go on the "a human reads it" list. Copy changes and layout tweaks don't.
2. Own the design and let the agent fill it in
The most upvoted reply in the thread comes from someone who doesn't let the LLM design the code at all. They lay out the abstractions and how they interact, and the agent implements the gaps. They might not know how each unit is written, but they know each unit's job and how the units connect.
That's enough understanding to debug, to review a diff at the boundary level, and to notice when the agent is quietly reshaping your architecture.
3. Write down what the product should do before the agent writes code
If you can't read all the code, you need something else you can read. One commenter's workflow starts with interview-based design and spec: the agent asks about whatever it finds ambiguous before writing anything. Someone else boiled it down to "get really good at defining acceptance criterion."
Keep these as short user stories and scenarios in the repo, next to the code. A scenario like "a guest can't check out without a delivery address" is something a reviewer can understand in five seconds, and it gives tests something to point at.
4. Keep that description current as decisions happen
The same commenter cites Peter Naur's idea that programming is building a theory of the system in your head. Writing code by hand was how we built that theory. With agents, a lot of the real product decisions now happen in agent chats and meetings instead: "guests must enter an address", "retry the webhook twice, then alert".
If those decisions never make it back into your stories and scenarios, the written description goes stale within weeks, and so does every check built on it. Make "update the scenario" part of finishing a change, or use tooling that picks those decisions up for you.
5. Don't let the agent grade its own work
This is the sharpest worry in the thread. One commenter is uneasy when the AI writes both the code and the tests: "They might agree with each other and still miss the same thing." The replies have practical fixes:
- Split the roles: "The agent writing the code never writes the checks it's judged by", and those separate checks caught far more.
- Test the tests with mutation testing. One team added Stryker to CI and its first run surfaced hundreds of mutations the suite didn't catch.
- Ask for a failing test first. One reply argues that seeing a test fail before the fix goes in gives you a lot of confidence.
For a deeper checklist, see our guide on how to trust AI-written tests.
6. Measure coverage against intent, not test count
An agent can write 400 tests that all hit the happy path. What you need to know is which of your scenarios have a test that would fail if the behaviour broke, which API operations and error responses were exercised at all, and whether the flows real users depend on are covered. A test count answers none of that. Track coverage against the scenarios from step 3, and against your API spec, and review the gaps rather than the totals.
7. Turn every escaped bug into a guardrail
One of the most practical replies treats agents the way engineering management treats teams. Every time the agent ships a bug, ask how to rule out that whole class of bug. Their example: agents kept writing broken database migrations, so they added a migration testing framework that runs each migration over data in the old schema and checks the result. Do that repeatedly and trust is something you earn one bug class at a time.
8. Keep a named human on every release
Someone still has to say "this is ready." As one commenter put it, you can't fire the agent when things go wrong. Before each release, a person should look at which scenarios changed, which have reviewed tests behind them, what's still uncovered, and what changed in the high blast radius areas from step 1. Then they sign off by name.
The catch: doing all of this by hand every week
Each of those steps works. The trouble is keeping them going when an agent ships ten changes a day. Specs drift, nobody updates the scenarios, the suite fills with tests nobody reviewed, and "are we covered?" turns into a gut call again. Claude Code can write the tests. It won't tell you on its own whether the right things are tested or whether the description it tested against is still true.
How TestChimp makes this ongoing
TestChimp runs the loop around your coding agents so the steps above happen on every change instead of when someone remembers.
The product description stays current. AgentWatch watches your team's coding agent sessions (Cursor, Claude Code, Codex and others), spots product decisions, and proposes updates to your stories and scenarios. MeetBots do the same for decisions made on Meet, Zoom, Teams or Webex calls. You approve each update, and it lands as Markdown in your repo. That covers steps 3 and 4.
QA runs against that description. Tests link back to scenarios, so every check points at a behaviour someone agreed on.
You see what's actually covered. Semantic coverage shows which parts of the product's scenario space have tests and where duplicates pile up. API contract coverage overlays real request and response payloads from test runs on your OpenAPI spec to show untested operations, fields and status codes. TrueCoverage is a Growth-plan feature that compares what real users do in production with what your tests exercise. Your coding agents get those gaps as work to close, which is step 6 running continuously.
Humans approve agent-written tests and releases. With Verified Tests, a person reviews a test against its scenario and stamps it as verified. If an agent later patches that test, the verification can be marked stale until someone checks it again. Release governance rolls test runs, issues and release checks into one readiness view per version, and CI can gate on the same data. That's step 8 with evidence attached.
You still own the design and the high blast radius code. TestChimp makes sure the behaviour you agreed on is written down, tested and visible every time the agent ships.
FAQ
Do I need to read every line of AI-generated code before shipping?
No, but someone needs to read the high blast radius parts: schema and migrations, auth, payments, permissions. For the rest, focus on understanding the design and checking behaviour against written scenarios with tests the coding agent didn't grade for itself.
How do I review code from Claude Code when the diffs are huge?
Review at the boundaries. Check the diff against your design (did it add a dependency, change an interface, touch a high-risk module?), then check the behaviour against the scenarios it was meant to satisfy. Ask the agent to split large changes into smaller commits and to explain parts you don't follow, then confirm the explanation against the code.
Can I trust tests that the same AI wrote along with the code?
Only after checking them. The code and tests can share the same blind spot. Have the tests derived from scenarios written before the code, review that each test can fail for the right reason, and add mutation testing or a separate checking agent where the risk is high.
What should a team check before releasing agent-written code?
Which scenarios changed, which have a reviewed test behind them, which API operations and error paths were exercised, what real-user flows remain uncovered, and whether anything changed in high-risk areas. Then a named person signs off.
How do we keep specs current when decisions happen in agent chats?
Treat "update the scenario" as part of done, or capture decisions automatically. TestChimp's AgentWatch proposes story and scenario updates from coding agent sessions, and MeetBots do the same from meetings, with a human approving each change.
Is TestChimp a replacement for Claude Code or Playwright?
No. Claude Code and other coding agents write the code and the tests. TestChimp works alongside them: it keeps the product description current, measures QA coverage against it, feeds the gaps back to the agents, and gives humans approval over tests and releases.




