optimize

An experiment loop for improving a measurable software result, such as test coverage or bundle size. You provide a goal, a shell command that reports the measurement, and a target value.

In plain words
What is it for?
Use it to increase or reduce a metric over repeated experiments, including test coverage, built-file size, or the number of lint problems.
Why use it?
It avoids making a series of changes without knowing whether they helped. Git checkpoints and rollback let it return to an earlier state when an experiment does not improve the result.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/joris887/exosuit/optimize
Any agent
npx skills add joris887/exosuit --skill optimize
Clone the repo
git clone --depth 1 https://github.com/joris887/exosuit

Made for: Claude Code, Codex.

Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,250 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00027 $0.02250
Opus 5 $0.00014 $0.01125
Sonnet 5 $0.00005 $0.00450
Haiku 4.5 $0.00003 $0.00225

Measured 2d ago against content hash 6c899b8654b7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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/skills/optimize/SKILL.md · 270 lines

How it starts

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


optimize

Optimizing: $ARGUMENTS

Argument Parsing

Argument Required Default Description
<goal> Yes - What to optimize (e.g., "increase test coverage", "reduce bundle size")
--metric "<command>" Yes - Shell command that outputs the metric value. Pipe through grep if needed to isolate the number
--target <N> Yes - Target value to reach
--direction min|max No max Whether to minimize or maximize the metric
--max <N> No 20 Maximum experiments before stopping

Examples:

/optimize "increase test coverage" --metric "npm test -- --coverage 2>&1 | grep 'All files' | awk '{print $10}'" --target 90 --direction max
/optimize "reduce bundle size" --metric "npm run build 2>&1 | grep 'gzipped' | awk '{print $3}'" --target 150 --direction min --max 30
/optimize "eliminate lint warnings" --metric "npm run lint 2>&1 | tail -1 | grep -oE '[0-9]+ problems'" --target 0 --direction min

Failure State Persistence

At loop entry, write docs/sessions/.failure-state.md:

---
status: active
skill: optimize
phase: "baseline"
phase_name: "Baseline Measurement"
started_at: "[ISO-8601 timestamp]"
story: "[goal from $ARGUMENTS]"
branch: "[from git branch --show-current]"
next_action: "Measure baseline metric"
files_modified: []
---

## Context
Goal: [goal]
Metric command: [command]
Target: [target] (direction: [min|max])
Max experiments: [max]
Current experiment: 0
Best value: [pending]

Update at each experiment iteration. Delete when optimization completes or max experiments reached.

Process

1. Pre-Flight

Run verify-clean-git-state micro-component. Confirm:

  • Working tree is clean (no uncommitted changes)
  • On a feature branch (not main/master)
  • Git is available

Read the full file on GitHub · 270 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. 2d ago First seen · 270 lines · 27 tokens per session scan A 6c899b8654b7

Subscribe to this mod's changes

optimize is a skill published in the GitHub repository joris887/exosuit (4 stars, last pushed 13d ago), licensed MIT. It adds 27 tokens to every session and 2,250 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-08-31.

Related

Other skills, from other repositories

issue-triage

Issue triage: audit open issues, categorize, detect duplicates, cross-ref PRs, risk assessment, post comments. Args: "all" for deep analysis of all, issue numbers to focus (e.g. "42 57"), "en"/"fr" for language, no arg = audit only in French.

rtk-ai/rtk · 70 tokens

ship

Build, commit, push & version bump workflow - automates the complete release cycle.

rtk-ai/rtk · 16 tokens

pr-review

Batch review des PRs RTK par ordre de complexité croissante (XS → S → M → L). Pour chaque PR : vérifie l'état (conflits, CLA, reviews), lit le diff complet, analyse le code en contexte, présente un résumé avec lien + taille + recommandation. Attend validation explicite avant tout merge. Poste des commentaires…

rtk-ai/rtk · 128 tokens

rtk-triage

Triage complet RTK : exécute issue-triage + pr-triage en parallèle, puis croise les données pour détecter doubles couvertures, trous sécurité, P0 sans PR, et conflits internes. Sauvegarde dans claudedocs/RTK-YYYY-MM-DD.md. Args: "en"/"fr" pour la langue (défaut: fr), "save" pour forcer la sauvegarde.

rtk-ai/rtk · 96 tokens

code-simplifier

Review RTK Rust code for idiomatic simplification. Detects over-engineering, unnecessary allocations, verbose patterns. Applies Rust idioms without changing behavior.

rtk-ai/rtk · 36 tokens

build-teaql-app

Build or change a TeaQL application in Java, Rust, Go, Swift, Python, C#/.NET, or TypeScript, including Kotlin/JVM applications that consume Java-generated libraries. Mandatory order: first draft and save a complete KSML model, then verify the client and evaluate that saved model, repair it through repeated evaluation…

teaql/teaql-agent-kit · 112 tokens