Claude Caught ChatGPT's Code Style: Can AI Recognize AI?

Claude caught a user pasting ChatGPT code, revealing how LLMs detect AI-generated content through style and context.
A Reddit post sparked discussion after a user learning Python with Claude secretly pasted ChatGPT-generated code into their conversation — and got caught. The article explains that Claude has no built-in detector; rather, LLMs are highly sensitive to stylistic distributions, and conversational context provided a baseline that made the sudden style shift a clear signal. Different models develop distinct "writing fingerprints" through RLHF fine-tuning. However, this recognition is unreliable — existing detection tools have high false-positive rates, making Claude's catch a contextual inference rather than a proven technique. The key takeaway: when learning to code with AI, there's no substitute for writing the code yourself.
An Unexpected Discovery While Learning to Code
Recently, a fun post on Reddit sparked discussion among AI enthusiasts. A user learning Python with Claude shared an interesting experience: after mastering the classic algorithm problem "3Sum," Claude suggested they write an example on their own. Instead, the user took a shortcut — they asked ChatGPT to generate the code, then pasted it back into their conversation with Claude.
What happened next was unexpected: Claude saw right through it, recognizing that the code wasn't written by the user but by ChatGPT. The poster was stunned: "Even Claude knows I copy-pasted from ChatGPT 💀"

What seems like a humorous moment actually touches on a fascinating technical question: Can AI models genuinely recognize content generated by another AI? The answer is more complex than it appears.
Can AI Really "Recognize" Each Other?
It's Not "Detection" — It's Style Recognition
First, let's clear up a common misconception. Claude doesn't have some built-in "ChatGPT detector" that scans code and definitively flags it as AI-generated. More accurately, large language models have an exceptionally strong sensitivity to text style.
Different AI models develop their own distinct "writing fingerprints" through extensive training and fine-tuning. In code, for example, Python generated by ChatGPT tends to have recognizable characteristics:
- Overly detailed comments: nearly every line comes with an explanatory annotation
- Standardized but slightly verbose naming: e.g.,
nums_sorted,result_list - Fixed structural patterns: a preference for specific boundary checks and error-handling conventions
- Textbook-style formatting: complete with docstrings and type annotations
When a piece of code suddenly shifts from "the tentative strokes of a learner" to "a polished, standards-compliant model answer," that jarring stylistic leap is itself a strong signal.
The formation of a "writing fingerprint" is closely tied to RLHF (Reinforcement Learning from Human Feedback) fine-tuning. After pre-training, different companies fine-tune their models using their own preference data to align outputs with specific style standards — for instance, OpenAI tends to train ChatGPT to produce clearly structured, well-annotated code examples, while Anthropic applies a different interaction style when training Claude. This fine-tuning process leaves a perceptible "brand imprint" in model outputs, manifesting as systematic preferences in vocabulary choice, code structure, error-handling patterns, and more. It's precisely these differences — shaped by training data and reinforcement learning objectives — that give each model's output its own characteristic style distribution.
Conversational Context Is the Key Clue
You might not have noticed: Claude's ability to "sense" something was off depended heavily on conversational context. Throughout the learning session, Claude had already "seen" the user's prior code style, the way they asked questions, and their level of understanding. When a piece of code appeared that clearly exceeded the user's current skill level and bore the hallmarks of ChatGPT's style, it was entirely reasonable for the model to infer, "this doesn't look like something you wrote."
This is actually similar to the intuition an experienced teacher develops when grading assignments — when a student who normally struggles suddenly turns in a perfect answer, questions naturally arise.
The Technical Principles Behind It: How LLMs Perceive Text Style
Statistical Characteristics of AI-Generated Text
At their core, large language models are probabilistic models trained on massive corpora. They are extraordinarily sensitive to the distributional patterns of language and can pick up on subtle patterns that humans would never notice. Research shows that AI-generated text tends to exhibit statistical characteristics distinct from human writing across dimensions like lexical diversity, sentence structure, and perplexity.
In the domain of code specifically, AI-generated code tends to be more "predictable" — meaning each token's appearance more closely matches the model's expected distribution, making it easier for another large model to detect that distinct "machine quality."
Perplexity is a metric that measures how "surprised" a language model is by a given piece of text. Intuitively, if every word in a passage closely matches the model's predictions, perplexity is low; if the text is unpredictable, perplexity is high. AI-generated text tends to have lower perplexity because it's produced by a similar probabilistic mechanism — word choices skew toward "optimal" solutions and lack the randomness and personal preferences found in human writing. Early detection tools like GPTZero relied heavily on perplexity metrics. A related concept is burstiness, which refers to the degree of variation between complex and simple sentences within a text — human writing typically shows more pronounced burstiness, while AI-generated text tends to be relatively smooth and uniform. Together, these two dimensions form an important foundation for current AI content detection methods.
The Limitations of AI Content Detection
That said, it's important to emphasize: this recognition capability is not stable and should not be treated as a reliable detection method. Current AI content detection tools in the industry (such as GPTZero) have fairly high false-positive rates. The reasons include:
- Well-written, standards-compliant code by skilled human developers can equally be misclassified as AI-generated
- AI-generated code that has been edited and polished becomes significantly harder to identify
- Stylistic differences between models are gradually blurring as technology evolves
For these reasons, Claude's "accurate detection" in this case is better understood as a reasonable inference in a specific context, rather than a reliable identification technique.
What This Small Incident Tells Us
A Reminder for Those Learning to Code with AI
Though this post was written with a self-deprecating tone, the lesson it carries is worth reflecting on for anyone learning a technical skill. When using AI to help learn programming, real growth comes from doing the work yourself. Claude's suggestion to write an example independently was intended precisely to reinforce understanding of the 3Sum algorithm. Bypassing that exercise to copy and paste might feel efficient, but it means missing out on the most valuable part of the learning process.
As many experienced developers emphasize: there is a vast gap between understanding code and being able to write it. The only way to bridge that gap is through repeated, deliberate practice.
Reflections on the Multi-AI Collaboration Era
From a broader perspective, this case also reveals an interesting phenomenon in today's AI tool ecosystem: multiple AI models are increasingly participating in the same workflow. Switching between Claude and ChatGPT to leverage the strengths of each has become a daily practice for many users.
In these "multi-AI collaboration" scenarios, stylistic differences between models and their ability to recognize each other's outputs may give rise to new applications — such as content provenance tracking and cross-model quality validation. Of course, this also reminds us that when mixing multiple AI tools, maintaining consistency in output style and the originality of content still requires active oversight from human users.
Conclusion
A slightly self-mocking Reddit post unexpectedly opened a window onto the discussion of AI style recognition. Claude's ability to "recognize" ChatGPT's code didn't rely on any mysterious detection black magic — it came from a large model's deep sensitivity to text style, combined with reasonable inference from conversational context.
For all of us, perhaps the most practical takeaway from this amusing episode is simple: when using AI to learn programming, don't cut corners when it's time to do the work yourself. After all, even the AI can tell when you're trying to fool it.
Related articles

Catalyst: A Vision for an Enzyme-Like Testing Framework for AI Agents
A developer shared Catalyst on Reddit, an Enzyme-inspired framework for AI Agents, exploring why agents need observable, testable dev tools and the design philosophy behind them.

The Real Capability of AI Coding Agents: Best Models Complete Only 35% of Feature Development Tasks
The 'Agents on Rails' benchmark finds top AI models complete only 35% of feature development tasks. What this means for coding agents and developer teams.

How to Prevent Duplicate Refunds After an AI Agent Crashes: CellaFlow's Durable Execution Approach
How can AI agents avoid duplicate refunds after a crash without deadlocking workflows? CellaFlow uses durable execution, shared work identity, leases, and fencing to solve safety and liveness in multi-agent systems.