optimize-ci

optimize-ci is a command for Claude Code from rjwalters/kicad-tools. It costs 50 tokens per session (5,530 once invoked), scanned A, original, MIT.

A report-only audit of GitHub Actions, the service that runs automated jobs for a repository. It checks whether workflows avoid irrelevant changes, reuse caches correctly, and stop older runs that a newer run replaces.

In plain words
What is it for?
It is for reviewing path filters, cache keys, duplicate or superseded runs, estimated savings, and proposed workflow changes.
Why use it?
It finds wasted CI minutes and also highlights filters that could skip checks needed for a safe build.

Command for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: reads .claude/ paths.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 .claude/skills/repo/scripts/repo-optimize-ci.py report --json.

Good fit It is for reviewing path filters, cache keys, duplicate or superseded runs, estimated savings, and proposed workflow changes.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/rjwalters/kicad-tools
agentmods
npx agentmods add commands/rjwalters/kicad-tools/optimize-ci

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for optimize-ci

README.md
[![agentmods](https://agentmods.dev/badge/commands/rjwalters/kicad-tools/optimize-ci/github.svg)](https://agentmods.dev/commands/rjwalters/kicad-tools/optimize-ci)
Your own site
<a href="https://agentmods.dev/commands/rjwalters/kicad-tools/optimize-ci"><img src="https://agentmods.dev/badge/commands/rjwalters/kicad-tools/optimize-ci/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for optimize-ci

Your own site · 80×15
<a href="https://agentmods.dev/commands/rjwalters/kicad-tools/optimize-ci"><img src="https://agentmods.dev/badge/commands/rjwalters/kicad-tools/optimize-ci.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,530 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00050 $0.05530
Opus 5.5 $0.00020 $0.02212
Sonnet 5.5 $0.00010 $0.01106
Haiku 4.5 $0.00005 $0.00553

Measured 1mo ago against content hash f1e78538bcee, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

optimize-ci scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/repo/optimize-ci.md · 430 lines

How it starts

The opening of the file, as written. The whole thing — 430 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/repo:optimize-ci — Stop CI Doing Work That Cannot Matter

Find the four ways CI routinely wastes runner minutes, prove how much each one costs from real run history, and propose the fix:

  1. No change-relevance filtering — full suites on documentation-only PRs, heavy jobs on changes that cannot affect them. And the opposite hazard: an existing paths: filter that omits a real input (a lockfile, the workflow file itself, a local action), which lets a breaking change merge green.
  2. Weak or missing caching — no toolchain cache at all, or a cache keyed so it never hits (github.sha in the key) or never invalidates (no lockfile hash in the key).
  3. Superseded runs — no concurrency: / cancel-in-progress, so every push to a PR leaves the previous run burning minutes; or duplicate push + pull_request triggers running the same commit twice.
  4. Default-branch cost — push-only workflows (deploys, main-only suites) with no ref-scoped group or an unconditional cancel-in-progress: true, and heavy suites that re-run on every merge although the PR already ran them.

Modeled on [[deps]]: a report-first audit of repo configuration that proposes changes and gates writes. The default mode and --check never write. --apply writes proposed workflow edits on a branch and opens a PR, under the same authorization convention as [[deps]] and [[release]]: apply existing authorization when it covers the concrete edits, otherwise show the diff and confirm first. Never push to the default branch.

The deterministic half — workflow parsing, trigger/paths/cache/concurrency extraction, required-check lookup, run-timing aggregation — is scripts/repo/repo-optimize-ci.py in the source checkout, installed to .claude/skills/repo/scripts/repo-optimize-ci.py. Every GitHub call it makes is a GET. This file is the judgment half: verifying what the helper inferred, choosing the right fix shape, and writing it.

Usage

/repo:optimize-ci                 # Report findings for this repo, ranked by estimated savings
/repo:optimize-ci --check         # Report only — never writes (same as the default)
/repo:optimize-ci --apply         # Write proposed workflow edits on a branch and open a PR — confirm first
/repo:optimize-ci --all-repos [--owner OWNER]   # Read-only org survey, repos ranked by wasted CI minutes

Read the full file on GitHub · 430 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +109 lines · +10 tokens per session f1e78538bcee
  2. 2mo ago First seen · 321 lines · 40 tokens per session scan A 52486703177e

Subscribe to this mod's changes

optimize-ci is a command published in the GitHub repository rjwalters/kicad-tools (77 stars, last pushed 15d ago), licensed MIT. It adds 50 tokens to every session and 5,530 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-02.

Related

optimize-ci compared with commands from other repositories

optimize-ci next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
optimize-cirjwalters/kicad-toolsCommand7715d agoMITA50Claude Code
dart-fix-cidartsim/dartCommand1.2kyesterdayBSD-2-ClauseA6Claude Code
domainsgotempsh/tempsCommand955todayApache-2.0A0Claude Code
check-release-healthopenshift-eng/ai-helpersCommand123yesterdayApache-2.0A22Claude Code
merge-conflict-analysisrjmurillo/ai-agentsCommand50todayApache-2.0A0GitHub Copilot
ADO: Get Build InfojnPiyush/AgentXCommand19todayApache-2.0A24GitHub Copilot
release-managerruvnet/agentic-flowCommand85020d agononeA0Claude Code