optimize

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

A controlled way to improve a measurable result through a limited number of changes, while checking safety conditions and recording each attempt.

In plain words
What is it for?
Use it for bounded performance or quality experiments with a metric command, guard checks, allowed files, and rollback criteria.
Why use it?
It prevents endless tweaking and helps catch changes that improve one measurement while breaking something else.

Skill for Claude CodeCodex

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

Good fit Use it for bounded performance or quality experiments with a metric command, guard checks, allowed files, and rollback criteria.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/borda/ai-rig/optimize
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Borda/AI-Rig --skill optimize
Clone the repo
git clone --depth 1 https://github.com/Borda/AI-Rig

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 optimize

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/borda/ai-rig/optimize"><img src="https://agentmods.dev/badge/skills/borda/ai-rig/optimize.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,641 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 77
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
How audits are shown
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.00018 $0.01641
Opus 5 $0.00009 $0.00821
Sonnet 5 $0.00004 $0.00328
Haiku 4.5 $0.00002 $0.00164

Measured yesterday against content hash c6c6bb99c415, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

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 yesterday.

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/codex-rig/skills/optimize/SKILL.md · 167 lines

How it starts

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

Optimize

Metric-driven optimization with explicit guards, rollback criteria, experiment log.

Input Schema

{
  "goal": "required measurable improvement objective",
  "mode": "single|campaign",
  "metric_cmd": "required command that emits or validates the target metric",
  "metric_direction": "higher|lower",
  "guard_cmd": "required command that must continue to pass",
  "max_iterations": "optional integer, default 1",
  "min_delta": "optional practical significance threshold",
  "scope_files": [
    "paths the optimization may edit"
  ],
  "done_when": "metric improves without guard regression"
}

Workflow

01: Create run directory

Run create_run.py --skill optimize per ../../shared/helper-cli-contract.md.

02: Validate metric and guard commands

Require:

  • Repeatable metric_cmd producing comparable value or pass/fail.
  • Known metric_direction.
  • guard_cmd fails on unacceptable regressions.
  • Bounded scope_files.
  • Explicit, bounded max_iterations for campaign.
  • Protect files/scripts used by metric_cmd/guard_cmd unless user explicitly scopes them and accepts measurement-integrity risk.

Dry-run both before edit:

Execute configured metric_cmd and guard_cmd separately with host-native command runner. Write complete combined output to <run-directory>/metric-baseline.txt and <run-directory>/guard-baseline.txt; retain both exit codes and stop before editing if either command cannot run.

03: Record baseline and hypothesis

Write <run-directory>/hypothesis.md:

  • metric to improve
  • expected mechanism
  • files allowed to change
  • guard risk
  • rollback condition

For campaign, noisy metrics, GPU/ML performance, or correctness-sensitive code, read and apply ../../shared/specialist-orchestration.md; otherwise do not load it. Write <run-directory>/specialist-optimization-plan.md with narrow context packs for:

  • squeezer: profiling mechanism, bottleneck hypothesis, measurement plan.
  • qa-specialist: guard coverage and regression risk.
  • data-steward: data pipeline or reproducibility impact.
  • scientist: metric validity, ablation design, statistical noise.
  • challenger: overfitting to metric or weakening guard checks.

Read the full file on GitHub · 167 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday Changed c6c6bb99c415
  2. 8d ago First seen · 167 lines · 18 tokens per session scan A 6edfd5edd609

Subscribe to this mod's changes

optimize is a skill published in the GitHub repository Borda/AI-Rig (27 stars, last pushed today), licensed Apache-2.0. It adds 18 tokens to every session and 1,641 once invoked, about $0.0001 per session on Opus 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-09-03.

Related

Other skills, from other repositories

i18n-parity

MANDATORY for every coding agent and contributor touching localized content — keep all five localization surfaces (dashboard UI keys, wiki page, mirrored READMEs, locale-aware formatting, language switchers) in parity across every supported language. Use automatically (without being asked) whenever you add or change…

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

file-headers

MANDATORY for every coding agent (Claude Code, Codex, or any other) on every change-set — every applicable source file the agent creates or updates MUST start with the project's copyright/authorship header (file overview + exact author line). Use automatically whenever writing a new file or editing an existing one; do…

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

productivity-score

Calculate a productivity score using actual Agent Monitor metrics — session completion rates, cache efficiency (cacheread vs input), compaction pressure (baseline tokens), turn velocity (turncount / totalturndurationms), tool success ratio (PreToolUse vs PostToolUse), and the workflow intelligence API's complexity and…

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

budget-set

Define a spend budget for Claude Code and, optionally, create a cost alert rule that fires when usage crosses the limit, via POST /api/alerts/rules on the Agent Monitor dashboard. Reads current spend from /api/pricing/cost to size the budget sensibly and explains every rule field before writing. Use when setting a…

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

dashboard-status

Quick dashboard health and status overview — checks the Agent Monitor API (port 4820), reports session/agent/event counts from /api/stats, confirms WebSocket connectivity, reads the redacted hook status returned by /api/settings/info, and shows data freshness (last event timestamp). Use to verify the monitoring system…

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

dag-map

Render the multi-agent orchestration DAG for a session — parent→child subagent edges, tree depth, and fan-out — from the Agent Monitor workflow intelligence API. Cross-checks the orchestration dataset against the raw agent records and session detail. Use when visualizing how a session's agent structure was organized.

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