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

Antigravity vs Claude Code (2026): Google's $0 Agent IDE That Runs Claude vs the Terminal Agent Metered on Your Claude Plan

Antigravity vs Claude Code, as of September 2026: Google's Antigravity is generally available at $0 for individuals with unlimited Tab and Command and weekly rate limits on its agents, and its model menu includes Claude Sonnet and Opus 4.6. Claude Code is Anthropic's terminal agent, included on Pro from $17 a month, Max from $100, and Team seats, running the current Sonnet 5 and Opus 5 against a five-hour usage pool. Free last-generation Claude in an IDE vs current Claude in a terminal: the decision, the limits, and the math.

6 min

Codex Usage Limits Explained: The 5-Hour Window, the Weekly Cap, and What Actually Resets (2026)

Codex doesn't have a message count. It has a rolling five-hour allowance that varies by model, a weekly cap that may sit on top of it, and a set of behaviors that quietly burn it faster. Here's what OpenAI's own pricing page says the limits are on Plus, Pro 5x, Pro 20x, and Business as of September 2026, what happens when you hit one mid-task, and the three moves that stretch the allowance before you pay $100 more a month.

6 min

Emergent vs Lovable (2026): Agent-Built Apps vs Prompt-Built Apps, and Which One You Can Actually Ship

Emergent vs Lovable is a bet on two different workflows. Lovable is the prompt-to-React builder with a $25/month Pro tier and the biggest ecosystem in the category. Emergent runs autonomous agents that plan, build, and test full-stack apps on a credit meter ($20 Standard, $200 Pro). Real 2026 prices, the credit math, the ownership question, and who should pick which.

6 min

Vercel vs Netlify in 2026: Netlify Meters Usage, Vercel Meters People, and Only One Free Plan Allows a Business

Vercel charges $20 per developer and gives you generous usage. Netlify charges $20 flat for unlimited developers and gives you 3,000 credits to spend. Vercel's free plan bans commercial use; Netlify's free plan just runs out. Which one you want depends on whether your constraint is people or traffic — and on whether you're shipping Next.js.

7 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: