AI Code Detection

Is this code written by
AI or a human?

Paste any Python snippet and our model — trained on Claude Haiku, GPT-4o, and Gemini 2.5 data using CodeBERT embeddings — will tell you instantly.

99% F1 on Gemini
984 Training samples
3 LLMs evaluated
Code Editor
Python
0 / 20,000
Verdict
—
Probability breakdown
AI-Generated —
Human-Written —
AI Human
Analysing…
● AST analysis: —
Methodology

How CodeSense works

01
AST Extraction
Your code is parsed into an Abstract Syntax Tree sequence using tree-sitter, normalising variable names to remove stylistic bias.
02
CodeBERT Embeddings
Both raw code and the AST sequence are embedded using microsoft/codebert-base, producing two 768-dimensional vectors.
03
Combined Features
The two vectors are concatenated into a 1,536-dimensional feature vector capturing both syntax and structure.
04
Classification
A Logistic Regression classifier — trained on 984 samples from Claude Haiku, GPT-4o, and Gemini 2.5 — returns a probability score.