Justin McKelvey
Fractional CTO · 15 years, 50+ products shipped
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 oneabove 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.
camelCasehere,snake_casethere, 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.
How AI Code Detection Actually Works: What the 99% Accuracy Claims Do Not Cover
Every detector sells a percentage. Read the vendor's own page and the percentage turns out to be about something else. GPTZero advertises "99% accuracy rates across diverse datasets," and the same page says accuracy "improves with longer inputs" and "is strongest on English prose." Its supported-language list is English, German, Portuguese, French and Spanish. No programming language is on it. Turnitin quotes a false positive rate under 1%, measured on documents that meet a 300-word requirement. Also prose. (Both pages read September 23, 2026.)
Now do the math the accuracy claim skips. Take the best published number at face value and apply it per file: a 1% false positive rate across a 300-file repository flags about three files a human wrote, before it has caught a single AI one. And the signal it measures, word rhythm, is the first thing a formatter rewrites. That is why the tells above check structure and review instead of style. Structure survives Prettier. A detector's signal does not.
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 →
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.
- How accurate are AI code detectors?
- Their published accuracy numbers are measured on prose, not code. GPTZero's own page says its accuracy is strongest on English prose and lists five supported human languages, none of them programming languages; Turnitin's under-1% false positive rate is for documents over 300 words. Applied per file, even a 1% false positive rate flags about three human-written files in a 300-file repository. A structural read is still the reliable method as of September 2026.
More on Vibe Code Rescue
Cursor Usage Limits (2026): Why Every Tier Is a Multiple of a Number Cursor Never Publishes
Cursor's pricing page sells Pro at $20, Pro+ at $60 and Ultra at $200, and describes what you get on each as "extended", "3x Pro" and "20x Pro" agent limits. It never says what Pro's limit is. Here is what is actually published as of September 2026, the one piece of arithmetic those multipliers do allow, and why Pro+ is the tier that buys you nothing per dollar.
Base44 Tutorial (2026): Build and Ship a Working Internal Tool in an Afternoon, Step by Step
A Base44 tutorial from someone who maintains 8+ Base44 apps: build a job tracker with a form, a table, and a status filter in ten prompts, add login and permissions, import your real data, and publish it, on the free plan's 25 credits. The exact prompt at each step, the four places builds go wrong, and the point where you stop and rebuild properly.
Is Emergent Free? (2026) What the $0 Plan's 10 Credits Actually Buy, Where the $20 Tier Starts, and the Cost That Is Not on the Pricing Page
Emergent has a free plan, and it is exactly as free as ten credits a month. Read from emergent.sh/pricing on September 15, 2026: Free is $0 with 10 monthly credits, Standard is $20 a month ($17 annual) for 100 credits and private hosting, Pro is $200 ($167 annual) for 750 credits, Enterprise is custom. Here is what ten credits buys on an agent that plans, codes, and deploys a whole app, the moment you have to pay, how it lines up against Lovable's and Base44's free tiers, and the cost every free plan leaves off the page.
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.5 and Opus 5.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.
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