Quantify AI Impact
in Your Codebase

Track, analyze, and report on contributions from Claude, Gemini, Codex, and Opencode — with absolute local security. See exactly how much code your AI assistants are actually writing.

npx ai-credit
ai-credit — analysis
ai-credit (main)

How it works.

A multi-adapter parsing engine that reads local AI session logs, extracts file operations, and verifies every line against your actual codebase.

01

Scan Session Logs

Each AI tool stores session data in its own format. ai-credit knows where to look and how to parse each one.

Claude Code|~/.claude/projects/JSONL
Codex CLI|~/.codex/sessions/JSONL
Cursor|~/Library/Application Support/Cursor/User/globalStorage/state.vscdbJSON
Gemini CLI|~/.gemini/JSON
Opencode|session logsJSONL
02

Extract File Operations

Identifies assistant messages containing tool_use, tool_calls, and functionCall blocks, then extracts every file write and edit operation with full paths and content.

// Parsed from assistant messages
{ "tool": "write", "path": "src/index.ts" }
{ "tool": "edit", "path": "lib/utils.ts" }
03

Verify Against Codebase

Only lines that currently exist in the codebase with exactly the same content are counted. Deleted or rewritten code is excluded — ensuring statistics reflect actual, surviving contributions.

Only surviving code is counted as AI contribution
100%
Verified Lines
Only existing code is counted
5
Tools Supported
Claude, Codex, Cursor, Gemini, Opencode
<5s
Analysis Speed
Multithreaded architecture

Built for precision.

Most tools just count chat history. We analyze the actual code that made it into production.

100% Secure & Private

Fully open-source. Your code never leaves your machine. No telemetry, no cloud processing.

Verified Existence

We verify every line against the current codebase. Deleted or rewritten code is excluded.

Visual Reports

Generate beautiful console charts, JSON data, or Markdown summaries for your PRs.

Universal Support

Works with any language. Analyzes text-based logs from your favorite AI tools.

Trusted by users of

Claude Code
Codex CLI
Cursor
Gemini CLI
Opencode

© 2026 ai-credit. Open source MIT License.