Skip to main content
Codluma

How AI Code Review Works#

Codluma performs a multi-stage analysis on every pull request diff, combining deterministic pattern matching with large-language-model semantic understanding to catch issues that neither approach could find alone.

Diff-only analysis

Only changed lines are sent for AI analysis — never your full source files or commit history.

claude-sonnet-4-6

Powered by Anthropic Claude Sonnet 4.6, one of the most capable models for code understanding.

Rule-based pre-scan

Deterministic checks for secrets, SQL injection, and OWASP patterns run before any AI call.

No training on your code

Your diffs are never used to fine-tune or retrain any shared AI model.

The review pipeline

01

Webhook received

GitHub or GitLab fires a pull_request webhook to Codluma the moment a PR is opened or a new commit is pushed.

02

Diff fetched

Codluma fetches only the unified diff of changed files. Files larger than 500 KB are skipped with a note in the review.

03

Rule-based pre-scan

Deterministic regex and AST-based rules check for hardcoded secrets, known injection patterns, and security anti-patterns in milliseconds.

04

AI semantic analysis

The sanitised diff (with secrets redacted) is sent to Claude Sonnet 4.6. The model analyses logic, security, performance, and code quality.

05

Finding deduplication

Findings from both stages are merged, deduplicated, and ranked by severity.

06

PR annotation

Each finding is posted as an inline comment on the exact line. A summary comment lists all findings with severity counts.

Timing & latency

PR size (changed lines)
Typical review time
< 50 lines
< 8 seconds
50–200 lines
8–20 seconds
200–500 lines
20–45 seconds
> 500 lines
Up to 90 seconds (files > 500 KB skipped)

Severity Guide#

Every finding is assigned one of four severity levels calibrated to real-world risk — not to inflate numbers or generate noise.

CriticalMust fix before merge

Security vulnerabilities that could allow data breach, authentication bypass, privilege escalation, or unrecoverable data loss. Examples: SQL injection, hardcoded credentials, RCE vectors.

PR effect: Block merge — PR status check fails.

HighFix strongly recommended

Logic errors, null pointer dereferences, race conditions, resource leaks, and incorrect behavior in important edge cases that could cause production incidents.

PR effect: PR status check shows warning.

MediumFix encouraged

Code quality issues, missing error handling, performance anti-patterns, deprecated API usage, and maintainability concerns that accumulate technical debt.

PR effect: Informational comment only.

InfoInformational

Style suggestions, naming improvements, documentation gaps, and minor improvements with no functional impact.

PR effect: Informational comment only.

Tip

Configure which severity levels block a merge in Settings → Review Rules → Blocking thresholds. By default only Critical findings block the merge.

Finding Categories#

Every finding is tagged with one of eight categories. You can enable or disable individual categories per repository in Settings → Review Rules → Categories.

Category
What it covers
Security
Injection risks, insecure defaults, credential exposure, OWASP issues
Performance
N+1 queries, inefficient loops, unnecessary allocations
Correctness
Logic errors, off-by-one, null dereference, unhandled cases
Maintainability
Overly complex functions, missing abstractions, dead code
Testing
Untested branches, missing assertions, test quality issues
Documentation
Missing or outdated docs on public APIs and functions
Style
Naming conventions, formatting, code organisation
Dependencies
Outdated packages, known vulnerabilities, unused imports

Tip

The Style-only toggle in Settings lets you exclude purely stylistic comments (naming, formatting) without disabling the Style category entirely. Useful for teams that enforce style via a linter.

Strictness Levels#

Strictness controls how aggressively the AI reviews. It affects both which categories produce findings and the confidence threshold required before a finding is posted.

Lenient

Only critical issues — security flaws and breaking bugs. Noise-free for teams iterating quickly.

Standard

Balanced feedback — correctness, security, and notable performance issues. The default for most teams.

Strict

Thorough review — all categories, moderate-confidence findings included. Suitable for production-critical services.

Pedantic

Everything — including stylistic nits, naming suggestions, and minor documentation gaps. Best for teams with high quality bars.

Note

The Confidence threshold slider (0–100%) works alongside strictness. Only findings the AI rates above the threshold are posted. Set it high (80%+) to cut noise; set it low (40%) when you want maximum coverage. The default is 65%.

Custom Review Rules#

Custom rules let you encode your architecture decisions, forbidden patterns, required libraries, and style standards so Codluma enforces them automatically on every PR.

Rule types

Pattern rules

Regex or glob patterns that flag specific strings, method calls, or file paths. Zero AI latency — runs in the pre-scan phase.

AI-guided rules

Plain-English instructions sent to the AI alongside the diff. Use for architectural constraints or nuanced style rules.

File-scope rules

Rules that only apply to specific directories or file extensions.

Suppression rules

Exclude specific files, patterns, or finding types — useful for generated code or vendored libraries.

Configuring rules via reviewops.yml

Add a reviewops.yml file to the root of any repository to configure rules for that repo.

reviewops.yml
# reviewops.yml — place in repo root
version: 1

review:
  blocking_severity: critical   # critical | high | medium | off

  forbidden_patterns:
    - pattern: "console\.log"
      message: "Remove debug logging before merge"
      severity: medium
      files: ["src/**/*.ts", "src/**/*.tsx"]

    - pattern: "TODO|FIXME|HACK"
      message: "Resolve outstanding TODO/FIXME before merging"
      severity: info

  exclude:
    - "**/__generated__/**"
    - "**/vendor/**"
    - "**/*.min.js"

  ai_instructions: |
    This codebase uses React Query for all data fetching.
    Flag any direct fetch() or axios calls in component files as High severity.
    All database queries must go through the repository layer in src/repositories/.
    Flag any direct DB calls in service or controller files as Critical.

Note

The reviewops.yml file is read on every PR — changes take effect immediately on the next PR without any dashboard action.

Fix Suggestions#

For Critical and High findings, Codluma generates a concrete code fix alongside the explanation, shown directly in the GitHub/GitLab review comment.

Example fix suggestion

GitHub PR comment (rendered markdown)
### 🔴 Critical — SQL Injection  (src/users/UserRepository.ts:47)

**Issue:** The `userId` parameter is interpolated directly into the SQL string.
An attacker controlling this parameter can execute arbitrary SQL.

**Vulnerable code:**
```typescript
const result = await db.query(`SELECT * FROM users WHERE id = ${userId}`)
```

**Fix:**
```typescript
const result = await db.query('SELECT * FROM users WHERE id = $1', [userId])
```

> Use parameterized queries for all user-supplied values.

When fixes are generated

Severity
Fix suggestion included
Notes
Critical
Always
Code snippet + explanation + reference link
High
Always
Code snippet + explanation
Medium
When applicable
Explanation + suggested approach
Info
Rarely
Explanation only

Warning

Fix suggestions are generated by AI and should be reviewed by a human before applying. They are accurate in the majority of cases but may require adaptation to your specific context or framework version.

Can't find what you need?

Contact support

We use cookies and analytics to understand how you interact with Codluma and improve your experience. We never sell your data. See our Privacy Policy and Terms for details.