@james-wall/codegov
v0.1.3
Published
AI code governance — attribution, telemetry, and ROI for AI-assisted development
Maintainers
Readme
codegov
Know what AI wrote in your codebase.
CodeGov scans your git history and detects commits authored by AI coding tools — Claude Code, Cursor, GitHub Copilot, Devin, and Aider — from git metadata alone. No config, no API keys, no agents to install.
$ npx @james-wall/codegov scan
82.3% of commits are AI-authored (283/344)
Agents: 280 claude-code, 2 copilot, 1 cursor
Detected commits:
c7e2a46 claude-code [Claude Opus 4.6] +0/-22 (95%)
07d9deb claude-code [Claude Sonnet 4.6] +8/-8 (95%)
5f90db7 copilot +83/-22 (95%)
...Install
npx @james-wall/codegov scan # try it now, no install needed
npm install -g @james-wall/codegov # or install globallyCommands
Zero-config (works on any repo)
codegov scan # scan full history
codegov scan --since 3m # last 3 months
codegov scan --format html # generate shareable HTML report
codegov stats # agent breakdown + monthly trends
codegov query --agent cursor --since 90d
codegov forensics <hash> # deep dive on a single commit
codegov export --format csv # export for spreadsheets
codegov export --format sbom # SPDX 2.3 compliance artifact
codegov share # upload HTML report as a GitHub GistOngoing monitoring
codegov init # install post-commit hook + scan history
codegov server # start OTEL collector + live dashboard
codegov server --port 8080 # custom portThe server accepts OpenTelemetry traces at POST /v1/traces (Claude Code natively supports OTEL export) and git commit metadata at POST /v1/hooks/commit, then correlates them to build tool-to-commit attribution.
How detection works
CodeGov identifies AI-authored commits by matching patterns in git metadata:
| Tool | Detection signals |
|------|------------------|
| Claude Code | Co-Authored-By: Claude trailer, Generated by Claude Code marker |
| Cursor | cursor[bot] author, [email protected] co-author, Made-with: Cursor trailer |
| Copilot | [email protected] co-author, copilot-swe-agent[bot] author, Agent-Logs-Url trailer |
| Devin | devin-ai-integration[bot] author email |
| Aider | aider (model) <[email protected]> co-author, aider: message prefix |
Each detection carries a confidence score (0-100%). The threshold is 30% — anything below is classified as human-authored.
Only the five named tools above are counted by default — each is matched on a specific, documented signature, so false positives are rare. A low-signal "generic AI" heuristic (e.g. an <ai@…> co-author with no specific tool) is available behind codegov scan --include-generic, but it is off by default to keep the headline number trustworthy. Detection reads commit metadata only, so the percentage is a floor: AI-assisted commits that carry no signature are not counted.
Export formats
- JSON — full audit report with summary + all records
- CSV — tabular, import into any spreadsheet
- SBOM — SPDX 2.3 for compliance workflows
- HTML — dark-themed dashboard, shareable as a standalone file
Use cases
- Engineering leaders: understand what % of your codebase AI wrote and which tools produce the most merged code
- Compliance teams: generate provenance artifacts for SOC2 auditors asking about AI-generated code
- Open source maintainers: add transparency about AI contributions
- Individual devs: track your own AI tool usage across projects
License
MIT
