ci-minutes-audit
A Claude Code skill (and two plain Python scripts) that shows where a repository's GitHub
Actions minutes go, and ranks the changes that would save the most, each sized from the
repository's own runs and each with a way to check that it worked.
What it does
- Collects runs and jobs for a time window with repo-scoped REST calls
(
gh api repos/{owner}/{repo}/actions/runs?created=…, …/runs/{id}/jobs). It also
collects each push's changed paths and the pull requests opened in the window. It does
not use the search API or GraphQL, which are often blocked or rate-limited. Everything
goes into a local cache, so you can re-run the analysis without any API calls.
- Bills every job the way GitHub does. Each job is rounded UP to a whole minute and
multiplied by its runner's rate: Linux 1, Windows 2, macOS 10, self-hosted 0.
- Breaks the minutes down by:
- workflow and job;
- event;
- conclusion;
- branch (default vs feature);
- change type, from a configurable path-to-component map: docs-only, one component,
several/shared;
- the steps inside the most expensive job.
- Reports:
- minutes per opened PR;
- run duration (median and p90);
- the waste share (failed, cancelled and re-attempted minutes);
- the rounding overhead;
- with your plan's numbers, the month's burn-down and a projection: when the included
minutes run out, and when the spending cap is hit.
- Proposes reductions from a catalogue of techniques
(
skills/ci-minutes-audit/references/techniques.md), ranked by expected minutes
saved. Each technique comes with its pitfall, a guard test and what to measure before
and after.
Why
On a private repository, Actions minutes run out quietly. When the spending cap is reached,
GitHub stops starting jobs, so CI, deploys and every open PR freeze at once. The usual
reaction is to guess: drop a test job, cache something. This tool measures instead.
The other reason is safety. The biggest savings come from running fewer tests, and a
test that did not run proves nothing. Every technique in the catalogue states what
proves the skipped work, and which test keeps that proof true. One of these lessons
was learned the hard way: a narrowed run was once accepted as proof before a deploy.
Install
As a Claude Code plugin (updates with the repository):
/plugin marketplace add Voyteck/claude-skill-ci-minutes-audit
/plugin install ci-minutes-audit@voyteck-ci-minutes-audit
As a plain skill: copy skills/ci-minutes-audit/ into your personal skills or one project's:
git clone https://github.com/Voyteck/claude-skill-ci-minutes-audit
cp -r claude-skill-ci-minutes-audit/skills/ci-minutes-audit ~/.claude/skills/ # every project on this machine
cp -r claude-skill-ci-minutes-audit/skills/ci-minutes-audit /path/to/repo/.claude/skills/ # one project, shared with its team
On claude.ai (Settings → Capabilities → Skills): upload a zip with the skill folder at
its root:
cd claude-skill-ci-minutes-audit/skills && zip -r ../ci-minutes-audit.zip ci-minutes-audit
Claude Code picks the skill up at the next session start.
The scripts also work without Claude. They need:
- Python 3.11 or later (standard library only);
- an authenticated
gh for collecting.
python3 skills/ci-minutes-audit/scripts/collect.py --days 14 # repo from the origin remote
python3 skills/ci-minutes-audit/scripts/analyse.py --plan-minutes 3000 --cap-usd 50 --used-minutes 1840
python3 skills/ci-minutes-audit/scripts/analyse.py --components components.json --json summary.json
python3 skills/ci-minutes-audit/scripts/collect.py --self-test && python3 skills/ci-minutes-audit/scripts/analyse.py --self-test
If gh is not available, save the GitHub MCP server's run and job listings as JSON. Then
load them with collect.py --import-runs … --import-jobs … --offline (see SKILL.md).
Example output
From the built-in synthetic dataset, trimmed:
Window … (2.0 days): 14 runs, 24 jobs, **65 billed min** (32/day, ~975 per 30 days).
Rounding each job up to a minute is 18% of them.
## Top cost centres (workflow / job)
| | billed min | share | jobs |
|---|---|---|---|
| CI / unit | 38 | 58% | 8 |
| Deploy / deploy | 12 | 18% | 3 |
| CI / lint | 8 | 12% | 8 |
## By change type
| | billed min | share | jobs |
|---|---|---|---|
| one component | 30 | 46% | 10 |
| n/a (workflow_dispatch) | 15 | 23% | 6 |
| several/shared | 12 | 18% | 4 |
| docs-only | 4 | 6% | 3 |
## Efficiency
- 5 pull requests opened: **13.0 billed min per opened PR**.
- Waste (failed, cancelled, timed-out jobs): **11%** (7 min); re-attempts billed 6 min.