Weekly CircleCI credit spend review posted to Slack

By General Input

Every Monday, see which CI pipelines burned the most credits last week, what they cost in dollars, and the few fixes that would save the most.

Integrations

  • CircleCI
  • Slack Bot
  • Google Sheets

Type

Agentic Task

Categories

  • Engineering
  • Finance

Every Monday at 9am, review where my CircleCI credits went last week and tell me what to fix.

Review these projects: [list your CircleCI projects here]. Project slugs take the form {vcs}/{org}/{repo}, for example gh/acme/api. There is no operation that lists every project on an account, so this list is user-supplied. If it is empty, ask me for it rather than guessing.

For each project, use the CircleCI operation "Get summary metrics for a project's workflows" and collect, for every workflow: total_credits_used, success_rate, total_runs, and duration_metrics, paying particular attention to median and p95. The reporting window is capped at 90 days and the underlying data refreshes once daily, so a Monday morning run reflects activity through Sunday.

Rank every workflow across all projects by total_credits_used. Then take the top three credit burners and call "Get summary metrics for a workflow's jobs" on each one to break the spend down to individual jobs, so I can see exactly which jobs are consuming the credits rather than just which pipeline.

Call out the waste patterns explicitly instead of just dumping numbers. First, workflows with a low success rate, where credits are being burned re-running failures. Estimate roughly how many credits and dollars the failed runs account for, since that is usually the biggest single lever. Second, jobs whose median or p95 duration has climbed compared with the longer 90 day baseline, because a job that is quietly getting slower is getting more expensive every week. If you want explicit trend figures rather than computing the deltas yourself, use "Get project summary metrics and trends". Third, jobs sitting on expensive resource classes. macOS, Windows, GPU, and Arm executors burn credits far faster than standard Linux containers, so flag them wherever they show up among the top spenders.

Post the ranked review to my engineering Slack channel using the Slack Bot "Send a Message" operation. Lead with the headline numbers: total credits spent across all projects, and the approximate dollar cost at 0.0006 USD per credit. Present the dollar figure as an estimate, because credit attribution comes from build insights metrics rather than a billing endpoint. Follow that with the ranked workflow list, then the waste patterns, then the two or three changes that would save the most credits, most valuable first. Keep it short enough to read on a phone.

Also append one row per workflow to my CI spend tab using the Google Sheets "Append Values" operation, so we can trend spend week over week and month over month. Each row should carry the run date, project slug, workflow name, total credits used, estimated dollar cost, total runs, success rate, and median and p95 duration. Append rather than overwrite so the history accumulates.

If a project returns no data for the window, say so in the report rather than skipping it silently, since that usually means the slug is wrong or my token cannot see that project. Write the whole thing for an engineering lead who owns the CI budget, not for a developer debugging a single test. The question I want answered is where the money went and what to change.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageLet support send one-off Loops emails without an engineerA brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensStop cold emails to anyone with a live deal in PipedriveLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasoniMessage campaign console with pre-flight checks and delivery board