Justin McKelvey

Justin McKelvey

Fractional CTO · 15 years, 50+ products shipped

Vibe Code Rescue 4 min read

How to Tell If Code Is AI-Generated: A CTO's Field Guide (2026)

Quick Answer

How do you tell if code is AI-generated? Not with a detector — none of them work reliably on code as of 2026. You read for the tells: comments that narrate the obvious, calls to APIs that don't exist, naming conventions that shift file to file, the same logic pasted in three places, defensive error handling around code that can't fail, and green test suites that assert nothing. One tell is a hint. Four or more is a pattern — and if it's your production codebase, a problem worth taking seriously.

Verified August 2026 · Author: Justin McKelvey, fractional CTO & AI consultant, 15 years in software, 50+ products shipped

TL;DR: The Detector You Want Doesn't Exist. The Skill Does.

Everyone searching this wants a scanner: paste the repo in, get a percentage out. I audit AI-built codebases for a living, and I'll save you the search — that tool doesn't reliably exist, and the ones that claim to are selling confidence, not accuracy. AI-text detectors work (badly) on prose because prose carries statistical fingerprints in rhythm and word choice. Code goes through formatters, linters, and compilers that erase exactly those fingerprints. What survives is structure — and structure is readable by a human in about ten minutes. This guide is that ten-minute read, from someone who does it weekly on rescue engagements.

Why "Check If Code Is AI-Generated" Tools Come Up Empty

Three reasons, all structural. First, training data: detectors learn on human-vs-AI prose pairs; code's vocabulary is constrained by syntax, so the signal is thinner from the start. Second, normalization: run any developer's code through Prettier or Black and it converges on the same shape AI output already has — the formatter destroys the evidence. Third, the mixed reality of 2026: most professional code is now human-directed AI output with human edits, so the binary question "AI or not?" is the wrong question. The useful question is the one the tells answer: was this code reviewed by someone who understood it?

The 9 Tells of Unreviewed AI Code

From real audits — every one of these has shown up in a codebase someone paid real money for.

  • 1. Narrated comments. // Loop through the users and check each one above a loop through users, checking each one. Humans comment why; AI comments what. Density of obvious comments is the single fastest tell.
  • 2. Hallucinated APIs. Calls to methods that don't exist in the installed version of the library — or at all. If the repo has ever needed a "fix undefined method" commit spree, you're looking at unverified generation.
  • 3. Convention drift. camelCase here, snake_case there, three different date-formatting approaches in one project. Each file reflects a different chat session's mood.
  • 4. Copy-paste logic. The same validation or transformation written out longhand in three controllers instead of extracted once. AI doesn't remember it already solved this two prompts ago.
  • 5. Ceremonial error handling. try/catch wrapped around code that cannot throw, while the network call two lines down goes naked. Defensiveness distributed by vibes, not by risk.
  • 6. Tests that assert nothing. A green suite full of expect(true).toBe(true)-grade checks, mocks that mock the thing being tested, and zero edge cases. Coverage without protection — the most expensive tell on this list.
  • 7. Uniform freshness. Whole files that arrive fully formed in single commits, with none of the scar tissue real code accumulates — no TODO, no commented-out attempt, no incremental history.
  • 8. Boilerplate maximalism. Every file carries the full ceremony — interfaces, factories, config objects — for a feature that needed twelve lines. AI scaffolds like it's billing by the abstraction.
  • 9. The knowledge test fails. The decisive one: ask whoever shipped it to walk you through a nontrivial file. If they can't explain their own code, it doesn't matter who wrote it — nobody reviewed it, and that's the actual risk.

What This Means If It's Your Codebase

If you're an owner or founder reading this because a contractor's deliverable feels off, or your vibe-coded app is starting to wobble — here's the honest framing. AI-written code isn't inherently bad; unreviewed code is, whoever wrote it, and AI just made unreviewed code cheap to produce at volume. The pattern I see on every rescue call is identical: the demo was great, the first two months were great, and then edge cases the prompts never mentioned started arriving as production bugs. That arc, and whether it's fixable, is covered in the honest case for and against vibe coding — the short version is that it's usually fixable, and rarely by a full rewrite.

The 20-Minute Owner's Audit (Do This Today)

You don't need to read code to run this. First, the knowledge test: ask your developer to walk you through the most important file on a screen share — tell #9 settles most cases in five minutes. Second, security surface: run my free 20-point vibe coding security checklist against the app; exposed API keys and missing auth checks are where unreviewed AI code gets expensive fastest. Third, count the tells above in any two files — a developer friend can do this over coffee. Zero to two tells: relax, review going forward. Four or more, on an app your revenue depends on: get a structural audit before you build anything else on top. That's the front door of Vibe Code Rescue — triage what's salvageable, stabilize what's load-bearing, rebuild only what's actually broken.

Next step Get the free repo audit →

Free Resource Justin McKelvey

What your AI stack actually costs

Prices changed 3x this year. The always-current cost sheet: sticker price vs what heavy use actually costs for Cursor, Claude, Replit, Lovable, Bolt & more.

Frequently Asked Questions

How can you tell if code is AI-generated?
Read for the tells, because no tool does it reliably. As of 2026 the strongest signals are: comments that narrate the obvious ("// Loop through the users"), API calls to methods that don't exist in the library version being used, naming conventions that change file to file, the same logic duplicated in three places instead of extracted once, defensive try/catch blocks wrapped around code that can't throw, and test suites that run green while asserting almost nothing. One tell is a hint; four or more is a pattern.
Is there a tool that detects AI-generated code?
No reliable one exists as of 2026, and be skeptical of anything that claims otherwise. AI-text detectors are trained on prose rhythm and vocabulary — signals that formatting, linting, and compilation strip out of code entirely. A human developer's code passed through Prettier looks statistically identical to Claude's. The dependable method is a structural read by someone who has seen a lot of both, which takes about ten minutes per repo and is the first step of every audit I run.
Does it matter if my developer used AI to write code?
Using AI isn't the problem — most good developers do as of 2026, and it makes them faster. The problem is unreviewed AI code: generated, pasted, and shipped without anyone understanding it. Reviewed AI code looks like the rest of the codebase and has tests that mean something. Unreviewed AI code accumulates what I call vibe debt — it works in the demo, then falls over on the edge cases nobody read closely enough to anticipate.
Why did my AI-built app work at first and then start breaking?
Because AI-generated code optimizes for the happy path it was prompted with. The demo flow works; the edge cases — concurrent users, malformed input, expired sessions, the database growing past toy size — were never in the prompt, so they were never handled. This is the standard arc of every rescue call I take: months one and two feel great, month three the bug reports outpace the fixes. The fix is a structured audit, not more prompting.
What should I do if my codebase is mostly unreviewed AI code?
First, don't panic-rewrite — some of it is probably fine. Run a security pass first (exposed keys, missing auth checks, and injectable queries are the expensive surprises; my free 20-point security checklist covers the scan order). Then get a structural audit that separates the salvageable from the load-bearing slop. If the app matters to your revenue, that's exactly what a rescue engagement is for — triage, stabilize, then rebuild only what's actually broken.

More on Vibe Code Rescue

OpenClaw Review (2026): What the Most-Starred Repo on GitHub Actually Does

OpenClaw is a free, open-source AI agent you text like a colleague — and it can genuinely run files, messages, browsers, and code on your machine. My honest review: what it does well, where it bites, what it costs to run, and who should (and shouldn't) install it in 2026.

4 min

Is OpenClaw Safe? What I'd Check Before Giving an AI Agent the Keys (2026)

OpenClaw is the most-starred repo on GitHub and it runs with real authority over your files, messages, and credentials. Safe? Out of the box, no — four CVEs, a browser-based hijack technique, and a skill marketplace that has shipped malware say otherwise. Here's the honest risk read and the checklist I'd run before letting it near a business machine.

5 min

Is Codex Free? What Actually Costs Money (2026)

The Codex CLI is genuinely free — open source, no license, no trial clock. The compute behind it is not. Here's what free actually covers, when a $20 ChatGPT Plus subscription is all you need, and the workloads that push you toward the $200 tier or a metered API bill.

4 min

Is Replit Worth It in 2026? Verdict by Who's Holding the Meter

Is Replit worth $25/month? Wrong number — the credit meter decides your real bill, and daily Agent builders land at $40-$80/month with $150+ months on record. Worth it for validating an idea? Emphatically yes. As your production home? Usually not. A segmented verdict with the real math, from someone who gets paid to rescue what AI builders ship.

5 min
Justin McKelvey, Fractional CTO and AI consultant in Austin, TX

Written by

Justin McKelvey

Fractional CTO & AI consultant in Austin, TX. 15 years building software, 50+ products shipped, $53M+ in client revenue generated. I help $1M–$50M founders ship production software and automate operations with AI — without hiring a full-time executive team.

Work with me

If this was useful, here are two ways I can help: