◉CLAUDE LABJP
●2.1.301 — Adds the vim % motion, LaTeX math rendering in the VS Code panel, and a retry-watchdog limit for usage-limit waits (10/15)●2.1.299 — Conversations over 200K tokens left idle about 54 minutes get compacted; MCP allow rules now match only the server they name●SONNET 4.5 — Retires on the Claude API on 11/30, 45 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●FAST MODE — Opus 5.5 fast mode is out of research preview and no longer needs the beta header (10/15)●NEW — I Put a Ten-Line Promise File at the To…●2.1.301 — Adds the vim % motion, LaTeX math rendering in the VS Code panel, and a retry-watchdog limit for usage-limit waits (10/15)●2.1.299 — Conversations over 200K tokens left idle about 54 minutes get compacted; MCP allow rules now match only the server they name●SONNET 4.5 — Retires on the Claude API on 11/30, 45 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●FAST MODE — Opus 5.5 fast mode is out of research preview and no longer needs the beta header (10/15)●NEW — I Put a Ten-Line Promise File at the To…
Articles/Claude Code
⟐ Claude Code/2026-06-14Advanced

Before Per-PR CI Burns Through Your Monthly Credits: A Three-Layer Guard for Claude Code GitHub Actions

From June 15, Claude Code GitHub Actions bills against non-rolling monthly credits. Run a review on every PR and you can drain the month in the first week. Here is a three-layer guard — when to run, how heavy one run can get, and making spend visible — with working workflows.

Claude Code264GitHub Actions12CI/CD19Monthly CreditsCost ControlProduction23

✦ Premium Article

Early in June I was scrolling the morning notifications and noticed my credit balance had already dropped below half. The month was three days old. The cause was easy to spot: the night before, twelve dependency-update PRs had landed at once, and the code-review workflow had fired on every single one of them.

As an indie developer I keep several app repositories, and I wire Claude Code review into their CI. Until now that ran inside my subscription, so I never watched the run count closely. The billing change on June 15 removes that cushion. Here are the three layers of guards I added to keep CI running while bringing the spend back under control — with the workflows that actually run.

What Changes on June 15: CI Leaves the Subscription

From June 15, 2026, the Claude Agent SDK, headless claude -p, Claude Code GitHub Actions, and third-party agents move onto monthly credits that sit outside your subscription limit. Credits are granted per plan (roughly $20 / $100 / $200 worth), consumed at the full API rate, and — critically — they do not roll over.

That last property is the one that bites. Leaving credits unused at month end is a loss, but spending them all in the first week means no automated CI review for the rest of the month. Under the subscription, "running too often" was still flat-rate; from now on, every run carves directly into the pool.

I wrote up the full scope of the change, and which steps are worth keeping headless, in how headless execution changes with the June 15 Claude Code billing update. This article drills into the piece that gets overlooked: GitHub Actions.

Spend Is "Number of Runs × Weight per Run"

Boiled down, credit spend is a product of two things:

  1. How many runs fired — how often the workflow started
  2. How heavy each run was — tokens read and written per run

The first number was what had broken. In my repos, review fired on both on: pull_request and on: push, and it covered everything without exception — bot dependency PRs, docs-only edits, even draft PRs. Fewer than half of the monthly CI starts were meaningful as human code review.

The second can't be ignored either. A refactor PR with several thousand changed lines loads the whole diff into context, costing tens of times the tokens of a normal run. Even after trimming the count, one "heavy run" like that can take a big bite out of the month.

So I worked in this order: cut the count with run conditions (layer 1), cap how heavy one run can be (layer 2), and make spend visible (layer 3).

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦Cut roughly 60% of the CI runs that were burning your monthly credits in the first week, using path/label/draft run conditions — without losing any human-facing review coverage
✦Build a diff-size and token ceiling into the workflow so a single massive PR can no longer swallow a large slice of the month's credits
✦Log each run's token spend to the job summary so you can decide, mid-month, how many runs you have left in plain numbers
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⟐ Claude Code2026-05-04
Build a Pipeline Where Docs Update Automatically Every Time Your Code Changes
Build a CI/CD pipeline that auto-generates README, CHANGELOG, and API docs whenever code changes. Use Claude Haiku 4.5 for cost-efficient classification and Sonnet 4.6 for quality output — cutting API costs by up to 70% while keeping documentation accurate.
⟐ Claude Code2026-04-07
An Implementation Notebook for Shipping Android/Kotlin Apps to Google Play with Claude Code
A production notebook from years of running an indie Android app business. Compose × Hilt × Room design calls, ProGuard crash triage, and a 14-item pre-release checklist that goes in front of every Google Play AAB upload.
⟐ Claude Code2026-07-29
The MCP Server Connects Fine and Still Hands Back Zero Tools — Catching Silent Capability Drift with a Tool Manifest Diff
A missing credential does not break the MCP handshake. initialize succeeds, tools/list succeeds, and the array comes back empty. Here is the measured behaviour, and a preflight that locks the expected tool surface and fails closed before the agent ever starts.