Detects AI-assisted git commits and tracks them locally — with optional remote sync, team dashboards, and device-based authentication. Install as a dev dependency, run init, and every commit made by Claude Code, GitHub Copilot, Cursor, Windsurf, Devin, Aider, Cody, Gemini, or Amazon Q is automatically logged.
- A
post-commitgit hook runs after every commit - The hook inspects the commit message for AI tool signatures (co-author trailers,
Generated-Bytags, etc.) - Detected AI commits are stored locally in
.autter/commits.json(gitignored) - Optionally, authenticate and sync commits to the autter server for team dashboards and cross-machine stats
npm install --save-dev autter-trackernpx autter-tracker initThis installs a post-commit hook and creates the .autter/ tracking directory. If a post-commit hook already exists, it appends rather than overwriting.
Installs the post-commit hook in the current repository.
Shows AI commit statistics — total counts, percentage of AI commits, and breakdown by tool.
AI Commit Statistics
Total commits in repo: 142
AI-assisted commits: 37 (26.1%)
Tracking since: 3/15/2026 — 4/4/2026
Breakdown by tool
Claude Code 22 ████████████
GitHub Copilot 9 █████
Cursor 6 ███
Shows recent AI-detected commits. Use --limit / -n to control how many.
npx autter-tracker log -n 10Authenticates with the autter server using the OAuth 2.0 Device Authorization flow. The CLI displays a code, opens your browser, and waits for you to approve.
npx autter-tracker loginClears stored authentication tokens.
Shows current auth and sync status — whether you're logged in, how many commits are synced, and last sync time.
Pushes locally tracked AI commits to the autter server. Requires authentication.
npx autter-tracker syncRemoves the post-commit hook. Add --clean to also delete the .autter/ data directory.
npx autter-tracker uninstall --cleanautter-tracker uses the OAuth 2.0 Device Authorization Grant (RFC 8628) for CLI authentication:
- Run
autter-tracker login - A code is displayed and your browser opens automatically
- Log in and enter the code to authorize
- The CLI receives a token and stores it securely at
~/.autter/auth.json(permissions0600)
Tokens are stored per-user, not per-repo. Once logged in, sync works across all your repositories.
The CLI defaults to https://api.autter.dev. Override with:
- Environment variable:
AUTTER_API_URL=https://my-instance.com - Config file:
~/.autter/config.json
| Tool | Detection Method |
|---|---|
| Claude Code | Co-Authored-By: Claude, Generated-By: PostHog Code, Generated with [Claude Code] |
| GitHub Copilot | Co-Authored-By: Copilot, github-copilot[bot] |
| Cursor | Generated-By: Cursor, [Cursor] |
| Windsurf | Co-Authored-By: Windsurf, Codeium |
| Devin | Co-Authored-By: Devin, devin-ai |
| Aider | aider: prefix, Co-Authored-By: aider |
| Cody | Co-Authored-By: Cody, Sourcegraph |
| Gemini | Co-Authored-By: Gemini |
| Amazon Q | Co-Authored-By: Amazon Q |
| Unknown AI | Any Generated-By: trailer |
import { detectAiTool, readStorage, BUILTIN_PATTERNS } from "autter-tracker";
// Detect AI tool from a commit message
const result = detectAiTool("fix: bug\n\nCo-Authored-By: Claude");
// { tool: "claude-code", displayName: "Claude Code", matchedPattern: "..." }
// Read stored commits
const data = readStorage("/path/to/repo");
console.log(data.commits);
// Check auth status
import { isLoggedIn, getConfig } from "autter-tracker";
console.log(isLoggedIn()); // true/false
console.log(getConfig()); // { serverUrl, clientId }This is an npm workspaces monorepo:
autter-tracker/
├── packages/
│ ├── cli/ # CLI tool + library (published as "autter-tracker")
│ └── api/ # Serverless API (Hono + Better Auth + Drizzle + Neon)
├── .env.example # Required environment variables (no secrets)
├── doppler.yaml # Doppler secret management config
└── package.json # Workspaces root
The API server runs on Cloudflare Workers with Neon PostgreSQL.
- Copy
.env.exampleand fill in your secrets - Set up a Neon database
- Configure Doppler or set secrets via
wrangler secret put - Deploy:
npm run deploy -w @autter/api
See .env.example for the full list of required secrets.
npm install # Install all workspace dependencies
npm run build # Build all packages
npm test # Run all tests
npm run typecheck # Typecheck all packages
# Per-package
npm run build -w autter-tracker # Build CLI only
npm run test -w autter-tracker # Test CLI only
npm run dev -w @autter/api # Run API dev serverMIT