·3 min read·Agency Play #121

The build shipped fast because Claude wrote half the code. Here's the AI technical debt audit that catches what's underneath before the client's engineer does.

by Ayush Gupta's AI

Delivery & OperationsHigh pain·1-2 hours per deliverable, built into the existing delivery checklist to implement

The problem

AI coding tools let agencies ship builds faster than ever, and that speed is hiding a new liability. Unreviewed AI-generated code works today and becomes unmaintainable tomorrow: duplicated logic across files, inconsistent patterns from prompt to prompt, missing error handling, dependencies nobody chose on purpose. Nobody notices during delivery because the demo works. The agency finds out when a client's in-house engineer inherits the codebase six months later and asks why nothing is documented and three different libraries do the same job.

Web dev agenciesAI automation agenciesApp development shopsFull-service digital agenciesAgencies building internal tools for clients

The fix

Run a structured AI-assisted technical debt audit on every AI-generated deliverable before handoff, so the agency finds and fixes the debt instead of the client's engineering team finding it first.

The Playbook

1

Accept that fast and clean are not the same thing

AI-generated code that passes a demo and AI-generated code that survives a client's engineering team for a year are different bars. Agencies that treat 'it works' as the finish line are the ones getting the call six months later asking why the codebase is a mess. Speed is the AI's job. Catching what the speed leaves behind is the agency's job.

2

Have Claude audit its own output before it ships, not after a complaint

Before a deliverable goes out, run the codebase (or the diff since the last audit) through a dedicated debt-audit pass. This is a different prompt than the one that built the feature — it needs to be adversarial, looking for what the build prompt didn't check.

Audit this codebase (or diff) for technical debt before client handoff. Do not just describe what the code does — find what will cause problems later.

Check for:
1. Duplicated logic that should be one shared function
2. Inconsistent patterns between files (different error handling styles, naming conventions, state management approaches)
3. Missing or swallowed error handling
4. Dependencies added that duplicate something already in the project, or that aren't actually needed
5. Anything that will confuse a new engineer with zero context on this specific build

For each issue found, rate it: fix now / flag and document / acceptable tradeoff.

Codebase or diff:
[PASTE]
3

Set a debt threshold, not a zero-debt bar

Chasing zero technical debt on every deliverable burns the speed advantage AI gave you in the first place. The real skill is deciding what's acceptable debt for this deliverable's timeline and budget, and what's a fix-now issue because it will break something a client depends on. Not every duplicated helper function needs to become a ticket.

4

Document the tradeoffs you knowingly shipped

When something gets flagged as acceptable debt instead of fixed immediately, write down why, in one line, next to the code or in the handoff notes. 'Shipped with duplicated validation logic in two components — refactor if a third one needs it' takes ten seconds and saves the next person (agency or client) from re-diagnosing something you already understood.

Turn this list of flagged technical debt items into short handoff documentation a client's engineer would actually read.

For each item, write one line: what it is, why it was an acceptable tradeoff at the time, and what would trigger fixing it.

Flagged items:
[PASTE FROM AUDIT]
5

Make the audit a checkpoint, not an afterthought

The audit only works if it happens before handoff, every time, not just on the deliverables someone remembers to double-check. Build it into the delivery checklist next to QA and client review, so it's a required step instead of something that depends on who's tired that week.

What changes

Fewer awkward calls from a client's engineering team asking what happened to the codebase, cleaner handoffs, and a paper trail showing the agency made deliberate tradeoffs instead of just moving fast and hoping nobody looked too closely.

AI coding tools let agencies ship builds faster than ever.

That speed is hiding a new liability.

The demo works. That's not the bar anymore.

Unreviewed AI-generated code that passes a demo and AI-generated code that survives a client's engineering team for a year are two different things. Duplicated logic across files. Inconsistent patterns from one prompt session to the next. Error handling that got skipped because the happy path worked. Dependencies nobody chose on purpose, just accepted because the AI suggested them.

None of it shows up during delivery. It shows up when a client's in-house engineer inherits the codebase and asks why nothing is documented and three different libraries do the same job.

The AI didn't create the debt problem. It just made shipping fast enough that nobody stops to check for it anymore.

Speed is the AI's job. Catching what it leaves behind is yours.

Chasing zero technical debt on every deliverable defeats the point of using AI to move fast in the first place. The actual skill is running a real audit before handoff, and then making a deliberate call: fix it now, flag and document it, or accept it as a reasonable tradeoff for this timeline and budget.

That's a very different thing from shipping whatever the AI produced and hoping nobody looks too closely.

Run an adversarial pass, separate from the build

The prompt that built the feature was optimizing for "does this work." The audit needs a different prompt, one whose only job is finding what the build pass didn't check: duplicated logic, inconsistent patterns between files, swallowed errors, unnecessary dependencies, anything that would confuse a new engineer with zero context on this specific build.

Run it before every handoff, on the diff since the last audit if the codebase is large. It takes an hour, not a sprint.

Write down what you knowingly shipped

When something gets flagged and the call is "acceptable for now," document it in one line. Not a formal report — a sentence next to the code or in the handoff notes explaining what it is, why it was fine at the time, and what would trigger fixing it later.

That one line is the difference between a client's engineer trusting the agency's judgment and a client's engineer assuming the agency didn't know the debt was there.

Bottom line

Agencies that treat AI-generated code as done once it demos well are the ones getting the awkward call six months later. The fix isn't slowing down. It's a short, adversarial audit before every handoff, a real threshold for what's acceptable debt, and a paper trail showing the tradeoffs were deliberate. That's what separates "moved fast" from "moved fast and left a mess."

Tools in this play

More agency plays every week.

Real workflows for agency founders, not generic AI advice.

Subscribe