Rig Optimize

Rig Optimize is a skill for Claude Code, Codex from Borda/AI-Rig. It costs 26 tokens per session (745 once invoked), scanned A, original, Apache-2.0.

A workflow for improving a measured performance result by changing one variable at a time and keeping only changes that beat baseline variation and pass correctness checks.

In plain words
What is it for?
Use it to optimize code when the project already has a benchmark that reports a stable metric and fails when the benchmark is invalid.
Why use it?
It prevents unmeasured or noisy performance tweaks from being treated as improvements and requires an existing benchmark gate rather than an invented test.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is Read [Evidence rules](../../references/evidence.md)..

Good fit Use it to optimize code when the project already has a benchmark that reports a stable metric and fails when the benchmark is invalid.

Compare 6 skills 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/Borda/AI-Rig
agentmods
npx agentmods add skills/borda/ai-rig/rig-optimize

Made for: Claude Code, Codex.

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 Rig Optimize

README.md
[![agentmods](https://agentmods.dev/badge/skills/borda/ai-rig/rig-optimize/github.svg)](https://agentmods.dev/skills/borda/ai-rig/rig-optimize)
Your own site
<a href="https://agentmods.dev/skills/borda/ai-rig/rig-optimize"><img src="https://agentmods.dev/badge/skills/borda/ai-rig/rig-optimize/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 Rig Optimize

Your own site · 80×15
<a href="https://agentmods.dev/skills/borda/ai-rig/rig-optimize"><img src="https://agentmods.dev/badge/skills/borda/ai-rig/rig-optimize.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 745 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.00026 $0.00745
Opus 5.5 $0.00010 $0.00298
Sonnet 5.5 $0.00005 $0.00149
Haiku 4.5 $0.00003 $0.00075

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

Security

Grade A, and why

Rig Optimize 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 today.

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.

plugins/opencode-rig/src/resources/skills/rig-optimize/SKILL.md · 42 lines

How it starts

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

Rig Optimize

Read Evidence rules.

This workflow changes code, one measured variable at a time. It never commits, pushes, or rewrites history; a human or rig-implement owns the commit.

Preconditions

  • The benchmark is an already-configured gate. Detect it with rig_gate and action: "detect".
  • The benchmark prints a stable metric and exits non-zero on failure.
  • There is no benchmark gate? Stop and ask the user to configure one. Never invent an ad-hoc benchmark command, and never use a paid or network-dependent benchmark without explicit approval.

Workflow

  1. Declare the contract. Metric, unit, direction (lower or higher is better), target, minimum improvement (default 5%), rounds budget (default 3), and the exact gate id. Start the run with rig_evidence and bind the benchmark script and fixtures as inputs.
  2. Measure the baseline. Run the benchmark gate at least three times from a clean start. Record every receipt, the median, the spread, and the environment (hardware, runtime version, cache state). Statistical noise is evidence, not an obstacle.
  3. Profile before editing. Use the project's profiler or timing instrumentation to name the hotspot. Profile output is an output, not a claim.
  4. Change one variable. State the hypothesis, the expected effect, the files to touch, and the rollback. Do not combine a refactor with a measurement round.
  5. Re-measure the same way. Rerun the benchmark gate at least three times under the same conditions. A win must exceed the baseline spread and the declared minimum improvement. Also run every non-benchmark gate: a faster build that breaks correctness is a regression.
  6. Decide and record. Keep the round when it wins and everything passes; otherwise restore the touched files exactly and record the failed hypothesis with rig_evidence action: "record" and a decision. Never rewrite or delete the measurement history.
  7. Stop honestly. Stop on target reached, improvement below noise after the round budget, a correctness regression, or an exhausted budget. A non-improvement is a valid result.
  8. Review independently. Dispatch rig-optimizer to check the methodology: sample count, variance, warmup, environment, and whether the benchmark still measures the intended behavior. Record it with reviewer.
  9. Finalize. rig_gate for the full set, then rig_evidence with action: "finalize".

Read the full file on GitHub · 42 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. today First seen · 42 lines · 26 tokens per session scan A d238a51b8726

Subscribe to this mod's changes

Rig Optimize is a skill published in the GitHub repository Borda/AI-Rig (29 stars, last pushed today), licensed Apache-2.0. It adds 26 tokens to every session and 745 once invoked, about $0.0001 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-28.

Related

Other skills, from other repositories

anomaly-alert

Identify anomalous sessions using Agent Monitor data — cost outliers from the pricing engine, token anomalies (cache miss spikes, compaction baseline surges), unusual event type ratios (PreToolUse/PostToolUse gaps, APIError clusters), behavioral deviations from workflow intelligence (complexity score outliers, error…

hoangsonww/Claude-Code-Agent-Monitor · 86 tokens

transcript-grep

Search a Claude Code session transcript for a string or regex pattern and show every matching message with surrounding context. Reads /api/sessions/:id/transcript and resolves sessions via /api/sessions?limit= from the Agent Monitor dashboard. Use when hunting for a specific message, prompt, tool call, or error inside…

hoangsonww/Claude-Code-Agent-Monitor · 73 tokens

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

jamditis/claude-skills-journalism · 21 tokens

verify

Verify Elixir/Phoenix changes — compile, format, and test in one loop. Use after implementation, before PRs, or after fixing bugs.

oliver-kriska/claude-elixir-phoenix · 33 tokens

hook-inventory

Inventory hooks across the user, project, and project-local settings plus the /.claude/hooks scripts directory — read through the Agent Monitor Config Explorer API — and flag hooks that POST to the network or run arbitrary commands. Reads /api/cc-config/hooks and /api/cc-config/hook-scripts. Use when auditing hook…

hoangsonww/Claude-Code-Agent-Monitor · 71 tokens

regression-watch

Detect quality and efficiency regressions over time using Agent Monitor data — rising error rate (APIError events), falling cache hit rate, growing compaction frequency, and climbing cost-per-session. Splits history into an earlier baseline window and a recent window and reports which metrics are getting worse, by how…

hoangsonww/Claude-Code-Agent-Monitor · 82 tokens