AI Code Transparency Tool โ detect AI-written code, analyze commit quality, track understanding debt, sprint health, bus factor, and more
Project description
๐งฌ CodeDNA โ AI Code Transparency Tool
Understand every line of code you commit. Is it really yours, or AI's?
Detect which code was written by AI, measure how well developers actually understand their commits, analyze commit quality, track trends, and map out "understanding debt" across your entire team.
Quick Start โข Features โข Commands โข Pricing โข Docs
๐ฏ The Problem
In 2026, developers write 78% of their code with AI help (Copilot, Cursor, ChatGPT, Claude). The result?
- ๐ฐ "Understanding Debt" โ Code is committed, but no one actually knows how it works
- ๐ Bus Factor = 1 โ Everyone uses the same AI, no one understands the codebase
- ๐ฐ Technical Debt Explosion โ Without human review, AI-generated code decays fast
- ๐ Bug Multiplication โ 3 months later: "Who wrote this? I don't even know what it does"
CodeDNA solves this. Every commit is scored. Every developer is measured. Every team gets visibility.
โจ Features
๐ AI Detection (4-metric fingerprint)
CodeDNA uses 4 heuristics to detect AI-generated code:
| Metric | AI Signature | Score |
|---|---|---|
comment_ratio > 0.3 |
AI over-comments its code | +0.20 |
avg_function_length > 50 |
AI produces large monolithic blocks | +0.15 |
single_commit_ratio > 0.7 |
Bulk-paste commits are AI-red flag | +0.30 |
| High complexity + single commit | AI signature โ +0.25 |
Total > 0.50 โ AI suspected. Combined with Tree-sitter AST analysis, this gives 80%+ accuracy.
๐ค AI Score Explanation
Each file's score includes a plain-English breakdown of why it scored that way:
- "High comment ratio (35%) โ AI-generated code tends to over-comment (+0.20)"
- "High single-commit ratio (85%) โ bulk paste indicator (+0.30)"
๐ Commit Message Quality Analysis
- Detects conventional commit types (
feat:,fix:,docs:, etc.) - Estimates quality score (0-5) based on message clarity
- Detects ticket references (JIRA, GitHub Issues)
- Score bonus for scope + ticket references
๐ Export & Import
codedna export --format json|csvโ export all datacodedna import file.jsonโ restore from export- API endpoints:
GET /export,POST /import
๐ค Developer Understanding Score
- Survey-based โ Quick Q&A after each commit
- Tracked over time โ See your understanding curve
- Trend charts โ Dashboard
/trendspage
๐ Bus Factor Analysis
- Ownership tracking โ Who owns which file?
- Risk identification โ Single points of failure
๐ฐ Technical Debt Estimation
- Cost in USD โ How much would it cost to fix this?
- Trend over time โ Is debt increasing?
๐ Sprint Health
- Velocity tracking โ Real commits vs. AI-assisted
- Quality metrics โ Per-sprint scoring
๐ Trend Charts (Dashboard)
Time-series visualization of:
- Daily average AI probability over time
- Understanding score trend
- Commit frequency bar chart
๐ Live Monitoring (codedna watch)
- Polls git repo for new commits (configurable interval)
- Auto-runs analysis on each new commit
--onceflag for cron-based usage--notifyfor webhook alerts
๐ Webhook Notifications (Slack/Discord)
- Configure via
codedna webhookinteractive wizard - Automatic alerts on high AI risk detection
- Protected module violation notifications
- Configurable risk threshold
๐ฌ Feedback Loop
- Dashboard
/feedbackpage - Mark AI detections as correct/incorrect/unsure
- API endpoints for CRUD operations
- Historical view of all feedback
๐ Multi-Repo Dashboard
- Add/remove repositories via dashboard
/repos - API-backed CRUD with
~/.codedna/repos.json - Centralized view across projects
๐ค AI Tool Comparison (Enterprise)
Copilot vs. Cursor vs. Claude โ which tool produces more debt?
๐ฏ Interview Tool (Enterprise)
Auto-generates questions from real code, records responses, exports reports.
๐ Developer Onboarding
Ramp-up curve, mentor matching, first PR analysis.
๐ก๏ธ Protected Modules
Mark critical files โ "AI may not touch auth/, payment/, security/"
๐ณ Docker Self-Hosted
docker compose up
# API โ http://localhost:8000
# Dashboard โ http://localhost:3000
๐ Quick Start
Installation
pip install codedna
First Use (60 seconds)
cd your-awesome-project
codedna init # Install git hook + create DB
codedna scan # Analyze all files
codedna status # Last commit score
codedna history # Past commits
Run the Dashboard
codedna dashboard # Web UI (port 3000) + API (port 8000)
codedna serve # API only (port 8000)
๐ Commands (30+ total)
๐ Analysis & Reporting
codedna scan # Full repo AI scan
codedna status # Last commit score + commit message analysis
codedna history # Commit history with understanding scores
codedna report # Generate HTML report
codedna ai-compare # AI tool comparison (Enterprise)
codedna export --format json # Export all data (JSON/CSV)
codedna import file.json # Restore from export
๐ Monitoring
codedna watch # Live repo monitoring (poll mode)
codedna watch --once # Single analysis (cron-friendly)
codedna watch --notify # With webhook alerts
codedna webhook --show # Show webhook config
codedna webhook --test # Send test notification
codedna webhook --reset # Clear webhook config
๐ก๏ธ Protection & Policies
codedna protect add <path> # Add protected module
codedna protect remove <path> # Remove protection
codedna protect list # List protected modules
codedna protect check # Show violations
๐ฅ Team & Process
codedna onboarding # Developer ramp-up (Team+)
codedna interview start # Start interview (Enterprise)
codedna interview list # List interviews
codedna interview score # Score interview
codedna bus-factor # Ownership analysis (Team+)
codedna debt # Technical debt (Team+)
codedna sprint create # Create sprint
codedna sprint health # Latest sprint score
codedna sprint history # All sprints
๐ Infrastructure
codedna serve # FastAPI REST (port 8000)
codedna dashboard # Web dashboard (port 3000)
codedna pr-comment # GitHub PR comment
codedna plan # Plan/license management
codedna setup # AI analysis config wizard
codedna security-check # Pre-publish secret scanner
codedna doctor # System health check
codedna update # Self-upgrade from PyPI
codedna uninstall # Remove git hook
๐ Pricing
| Plan | Price | Repos | History | Dashboard | Key Features |
|---|---|---|---|---|---|
| Free | $0 | 1 | 7 days | โ | AI detection, local only |
| Pro | $12/mo | โ | 90 days | โ | + Export, Webhooks, Watch |
| Team | $24/mo | โ | 365 days | โ | + Bus Factor, Sprint, Onboarding |
| Enterprise | $49/mo | โ | โ | โ | + AI Compare, Interview Tool, SSO |
๐ Integrations
- GitHub Actions โ Auto-comment on PR
- Jira โ Sprint health webhook
- Slack โ AI risk notifications
- Discord โ Webhook alerts
- GitHub Copilot / Cursor / Claude โ AI tool detection
- Docker โ Self-hosted deployment
๐ ๏ธ Architecture
CLI (Python, Typer, Tree-sitter, GitPython, SQLite)
โ
โโโ codedna scan / status / history
โโโ codedna export / import
โโโ codedna watch / webhook
โโโ codedna protect / bus-factor / debt
โโโ codedna sprint / onboarding
โโโ codedna serve / dashboard
โโโ codedna doctor / update / security-check
โ
โ HTTP
REST API (FastAPI, JWT Auth, Rate Limiting)
โโโ /health, /repo/*
โโโ /commits, /files, /report
โโโ /survey, /sprints, /bus-factor, /debt
โโโ /trends, /trends/commits
โโโ /feedback (POST + GET)
โโโ /repos (GET + POST + DELETE)
โโโ /export, /import
โโโ /auth (register, login, me)
โโโ /billing (checkout, webhook, subscription)
โ
โ HTTP
Web Dashboard (Next.js 14, TypeScript, Tailwind)
โโโ / (overview + metrics)
โโโ /files, /commits, /report
โโโ /bus-factor, /debt, /sprints
โโโ /trends (charts)
โโโ /feedback (AI accuracy feedback)
โโโ /repos (multi-repo management)
โโโ /ai-compare, /onboarding
โโโ /protected, /interview
โโโ /pricing, /billing
โโโ /login, /register
Self-Hosted (Docker)
git clone https://github.com/natureco-official/codedna.git
cd codedna
docker compose up
๐๏ธ Tech Stack
- Python 3.10+ with Typer, FastAPI, Tree-sitter, GitPython, SQLite
- Next.js 14 with TypeScript, Tailwind CSS
- Docker โ API + Dashboard containers
- Lemon Squeezy โ Billing
- uv โ Python packaging
๐ Security
- HMAC-SHA256 webhook verification
- bcrypt password hashing (cost 12)
- JWT tokens (7-day expiry)
- httpOnly + secure + sameSite cookies
- Parameterized SQL queries
- Pydantic input validation
- Rate limiting
- No telemetry โ your code stays yours
๐ Supported Languages
Python (.py), JavaScript (.js), TypeScript (.ts), JSX (.jsx), TSX (.tsx)
๐งช Testing
pytest # 23+ tests
pytest --cov=codedna # With coverage
๐ Documentation
- CLI Reference โ
codedna --helpor per-command--help - API Reference โ http://localhost:8000/docs (when running)
- Contributing Guide
- Security Policy
๐ License
MIT License โ Copyright (c) 2026 NatureCo
Made with ๐ฟ in Turkey
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codedna-0.9.1.tar.gz.
File metadata
- Download URL: codedna-0.9.1.tar.gz
- Upload date:
- Size: 297.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17748e7d0be5930bf8db6090e1091540d9f48e17af27cb37008457dea3b06743
|
|
| MD5 |
fbe173087dbc66ca4633b9674c0dafb0
|
|
| BLAKE2b-256 |
0a14247b5987ddf98286680320c5f1836666720ecb384aa1aa87d3aaab0858a1
|
File details
Details for the file codedna-0.9.1-py3-none-any.whl.
File metadata
- Download URL: codedna-0.9.1-py3-none-any.whl
- Upload date:
- Size: 340.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d8778c320634074947f0c70ed2ad4462126bfeaf149fa640b3e7f0fd0eed866
|
|
| MD5 |
404499240eb278dfb38d777cf8b852d9
|
|
| BLAKE2b-256 |
cdd9356c41bbb578cba7233263b637c9bab50b797f834fd2ba620de86632e4c4
|