aimpg · miles per gallon for AI coding

What does your AI coding really cost per change that ships?

Five minutes from install to your first numbers. aimpg reads the Claude Code, Codex and Cursor logs already on your laptop. Nothing leaves your machine unless you choose.

YOUR AI CODING Energy 14.46 – 130.59 kWh ≈ boiling a kettle 140–1,300 times Money $1,284 API-equivalent Output 353 commits made with AI help A typical kept commit: $2.05 Start a fresh session after each commit: up to 45% less energy, $397 A real receipt from one developer's last 30 days. Energy is a range because model sizes aren't public.
  1. 0:00

    Install

    One command with uv, the Python tool installer.

    uv tool install aimpg

    No uv yet? curl -LsSf https://astral.sh/uv/install.sh | sh first. Works on macOS and Linux.

  2. 0:30

    See your receipt

    Your last 30 days: energy, dollars, commits, the cost of a typical kept commit, and the two habits that would have saved the most, measured on your own logs.

    aimpg report

    Want to post it? Add --share for a card with your totals only. Using Cursor? Cursor keeps its token counts online: download them at cursor.com/dashboard → Usage → Export CSV, then add --cursor-usage ~/Downloads/usage-events.csv.

  3. 1:30

    Watch it live while you work

    A status line inside Claude Code shows what the current task has cost compared with your usual, and when starting fresh would save the most. After each commit you get one short note. It's never sent to the model.

    aimpg live install
    ⚡ task $1.96 · usual $2.05 · ctx 160k (92% from before your last commit) · /clear ≈ -92% per request

    It shows the change and asks first, and keeps a backup. Undo with aimpg live uninstall.

  4. 2:30

    Share your numbers with your team

    Adds a small note to each of your own AI-assisted commits (cost, energy range, request count) and pushes it with git. It never includes prompts or code. Each person on the team runs it for themselves.

    aimpg notes push
  5. 3:00

    Add the GitHub Action

    One file in the repo. Every pull request gets a comment with its AI cost. Every Monday, the run summary shows the team's cost per working change (commits still standing after 30 days), how much spend went on work that didn't last, and the weekly trend.

    .github/workflows/aimpg.yml
    
    on:
      pull_request:
      schedule: [{cron: "0 8 * * 1"}]
    permissions: {contents: read, pull-requests: write}
    jobs:
      aimpg:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
            with: {fetch-depth: 0}
          - uses: kumarganduri/aimpg@v0.6.3
            with:
              mode: ${{ github.event_name == 'pull_request' && 'pr' || 'rollup' }}
              comment: "true"
    ⚡ AI cost of this pull request $4.10 API-equivalent · 0.20–1.90 kWh · 9 model requests

    Team numbers appear only once at least 5 people share notes, and never per person.

  6. 5:00

    Done

    You now see the cost while you work, every pull request shows its cost, and the team gets a weekly number to improve: cost per working change. The first working-change verdicts arrive once your commits are 30 days old; aimpg keeps the history so it can tell.

What leaves your machine

CommandSends anything?What
aimpg report, live, sci, defaultsNoReads local logs and git only.
aimpg notes pushYour repoPer-commit cost, energy range and request count, on your own commits. Anyone who can read the repo can read the notes.
aimpg submitPublic scoreboardA stripped copy of a verify result. It shows you the exact file and asks first.
AnythingNeverPrompts, code, diffs, commit messages, API keys.

When you have more than five minutes

aimpg verify --challenger rtk

Check whether a token-saver, prompt, cheaper model or another agent really saves money on your commits. Your own tests decide. About $0.10–0.30 per run, and it asks before spending.

aimpg defaults --apply

Turn a result like "Sonnet solves our tasks at a third of Opus's cost" into the repo's default model for the whole team.

aimpg sci --json sci.json

Carbon intensity in the Green Software Foundation's SCI for AI format, for a sustainability report.

aimpg submit

Add your verified result to the public scoreboard, where results from many repos add up.