AI-Powered Code Review

Bugs Found.
Before They
Ship.

CodeBug combines Claude + GPT-4o to catch security flaws, logic errors, and style issues — with a reinforcement-learning grader that improves over time.

codebug — review
# POST /api/review ────────────────────── language "python" analyzing get_user.py … type bugsecurity severity 5 / 5 line 14 comment SQL injection via f-string interpolation fix cursor.execute( "SELECT * FROM users WHERE id = ?", (uid,)) reward +43correct █
15+
Bug Patterns
3
Languages
2
LLM Backends
RL
Self-Improving

Live Demo

Review Your Code.

Paste any snippet. CodeBug calls POST /api/review and returns a structured result — type, severity, comment, and a fix snippet.

Input max 5 000 chars
Result

Awaiting analysis…

Calling Claude API…
Category
—
Severity
Confidence
—
Line Hint
—
Comment
—
Suggested Fix

              
            
Capabilities

Every Layer,
Covered.

01
Security Detection

Catches SQL injection, hardcoded secrets, and plain-text passwords — each severity-scored from 1 to 5.

02
Logic Analysis

Off-by-one errors, wrong comparisons, missing null checks, and divide-by-zero traps across all supported languages.

03
Multi-Language

Python, JavaScript, and Java — each with language-idiomatic bug patterns in the bug bank.

04
Dual LLM Fallback

Claude Haiku runs first. Any exception silently falls back to GPT-4o-mini with no disruption to the API response.

05
RL Reward Grading

Every review earns a reward score. +25 for critical security catches, −25 for missed criticals. The model learns.

06
Review History

All reviews and training runs stored in SQLite. Query via /api/history and /api/stats endpoints.

REST API

Five Endpoints.
Zero Config.

Rate-limited to 20 req/min per IP. All responses are JSON. Start the server with python app.py.

Method Route Description Params
POST /api/review Submit code for AI review. Returns type, category, severity, comment, and fix snippet. code, language?
POST /api/train Run N RL training episodes. Auto-saves checkpoint. Returns full stats dict. episodes? (≤ 100)
GET /api/history Returns paginated list of past reviews from the SQLite database. limit? (≤ 200)
GET /api/stats Aggregate stats: training runs, review counts, average reward, top bug categories. —
GET /api/health Health check. Returns model name and DB connection status. —
Reinforcement Learning

Train the
Reviewer.

Run RL episodes against the bug bank. The grader rewards precision and penalises misses. Checkpoints auto-save and are fully resumable.

20
Reward Schedule
Correct — Security +25
Correct — Logic +15
Correct — Other +10
Correct — Approve +5
Severity exact match+5
Detailed comment +5
Non-empty fix field +3
Line hint provided +3
False positive −10
Missed critical bug −25
Missed high severity−20