npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

git-churn-ai

v0.1.0

Published

Analyze code churn with AI attribution detection — see what % of your codebase was written by AI tools

Readme

git-churn-ai

Analyze code churn with AI attribution detection — see what % of your codebase was written by AI tools.

Install

# Install globally
npm install -g git-churn-ai

# Or run without installing
npx git-churn-ai

Usage

Usage: git-churn-ai [options]

Analyze code churn with AI attribution detection.

Options:
  --since <date>    Git date range (default: "90 days ago")
  --repo <path>     Path to git repository (default: cwd)
  --output <file>   Output file path, or - for stdout (default: churn-report.md)
  --top <n>         Number of top churned files to show (default: 30)
  --ext <exts>      Comma-separated file extensions (default: .ts,.tsx,.js,.jsx)
  --format <fmt>    Output format: md or json (default: md)
  -h, --help        Show this help message

Environment variables: SINCE, REPO_PATH, OUTPUT, TOP_N, EXT

Examples

# Run in current directory, last 90 days
git-churn-ai

# Analyze a specific repo, last 30 days, output to stdout
git-churn-ai --repo ~/my-project --since "30 days ago" --output -

# Top 10 files, JSON output
git-churn-ai --top 10 --format json --output report.json

# Analyze only TypeScript files
git-churn-ai --ext .ts,.tsx

# Analyze Python project
git-churn-ai --repo ~/my-python-project --ext .py

Example Output

# Code Churn Report with AI Attribution

> Generated: 2025-01-15T10:30:00.000Z
> Repo: `/Users/you/my-project`
> Since: `90 days ago`

## Summary

| Metric | Value |
|--------|-------|
| Total files with churn | 142 |
| Total codebase lines | 48,320 |
| Total churn lines | 12,450 |
| Churn as % of codebase | 25.8% |
| AI-attributed churn lines | 3,210 |
| AI churn as % of total churn | 25.8% |
| AI churn as % of codebase | 6.6% |
| Total commits | 87 |
| AI commits (confirmed + suspected) | 22 (25.3%) |
| Confirmed AI commits | 18 |
| Suspected AI commits | 4 |

## AI Churn Overview

Total Churn   [███░░░░░░░] 25.8% of codebase
AI Churn      [███░░░░░░░] 25.8% of churn is AI-attributed
AI Commits    [███░░░░░░░] 25.3% of commits show AI signals

## Top 30 Files by Churn

| # | File | Churn | +Added | -Deleted | Commits | AI Signal | AI% | AI Bar |
|---|------|------:|-------:|---------:|--------:|-----------|----:|--------|
| 1 | `src/components/Dashboard.tsx` | 842 | +621 | -221 | 12 | 🤖 confirmed | 75% | ██████░░ |
| 2 | `src/hooks/useAuth.ts` | 634 | +412 | -222 | 8 | 🔶 suspected | 38% | ███░░░░░ |
| 3 | `src/screens/HomeScreen.tsx` | 511 | +389 | -122 | 6 | — | 0% | ░░░░░░░░ |

How AI Detection Works

git-churn-ai uses three confidence levels to detect AI-written code:

🤖 Confirmed

A commit is confirmed as AI-generated when:

  • The git author name or email contains a known AI tool name (e.g. claude, copilot, cursor, gpt, openai)
  • The commit has a Co-Authored-By: trailer matching a known AI tool

🔶 Suspected

A commit is suspected as AI-generated when the commit message or body contains keywords like:

  • claude, copilot, ai:, ai-generated, generated by
  • gpt, cursor ai, via ai, [ai], [claude], [copilot]

— No signal

No AI indicators detected in author info, trailers, or commit message.

Config

Recognized AI author patterns (checked against author name and email):

claude, copilot, github-actions[bot], openai, chatgpt, gpt, cursor

Recognized Co-Authored-By patterns:

claude, copilot, openai, cursor, gpt, github-copilot

Commit message keywords (subject + body):

claude, copilot, ai:, ai-generated, generated by,
co-authored-by: claude, gpt, cursor ai, via ai, [ai], [claude], [copilot]

JSON Output

Use --format json for machine-readable output:

{
  "meta": {
    "since": "90 days ago",
    "generatedAt": "2025-01-15T10:30:00.000Z",
    "repoPath": "/Users/you/my-project"
  },
  "summary": {
    "totalFiles": 142,
    "totalCodebaseLines": 48320,
    "totalChurnLines": 12450,
    "pctChurnOfCodebase": 25.77,
    "aiChurnLines": 3210,
    "pctAiChurnOfTotalChurn": 25.78,
    "pctAiChurnOfCodebase": 6.64,
    "totalCommits": 87,
    "aiCommits": 22,
    "pctAiCommits": 25.29,
    "confirmedAiCommits": 18,
    "suspectedAiCommits": 4
  },
  "files": [ ... ]
}

Requirements

  • Node.js >= 18
  • git available in PATH
  • grep available in PATH (for line counting)

License

MIT