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.
git clone --depth 1 https://github.com/Borda/AI-Rignpx agentmods add skills/borda/ai-rig/rig-optimizeWrote 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.
[](https://agentmods.dev/skills/borda/ai-rig/rig-optimize)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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-implementowns the commit.
Preconditions
- The benchmark is an already-configured gate. Detect it with
rig_gateandaction: "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
- 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_evidenceand bind the benchmark script and fixtures asinputs. - 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.
- Profile before editing. Use the project's profiler or timing instrumentation to name the hotspot. Profile output is an
output, not a claim. - 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.
- 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.
- 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_evidenceaction: "record"and adecision. Never rewrite or delete the measurement history. - 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.
- Review independently. Dispatch
rig-optimizerto check the methodology: sample count, variance, warmup, environment, and whether the benchmark still measures the intended behavior. Record it withreviewer. - Finalize.
rig_gatefor the full set, thenrig_evidencewithaction: "finalize".
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.
- today First seen · 42 lines · 26 tokens per session scan A d238a51b8726
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.
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…
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…
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
verify
Verify Elixir/Phoenix changes — compile, format, and test in one loop. Use after implementation, before PRs, or after fixing bugs.
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…
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…