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.
npx skills add wenhaochai/claude-plugins --skill optimizegit clone --depth 1 https://github.com/wenhaochai/claude-pluginsWrote 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/wenhaochai/claude-plugins/optimize)<a href="https://agentmods.dev/skills/wenhaochai/claude-plugins/optimize"><img src="https://agentmods.dev/badge/skills/wenhaochai/claude-plugins/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/wenhaochai/claude-plugins/optimize"><img src="https://agentmods.dev/badge/skills/wenhaochai/claude-plugins/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.00035 | $0.01688 |
| Opus 5.5 | $0.00014 | $0.00675 |
| Sonnet 5.5 | $0.00007 | $0.00338 |
| Haiku 4.5 | $0.00003 | $0.00169 |
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 17d 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.
How it starts
The opening of the file, as written. The whole thing — 146 lines — stays where its author put it; the contents beside it link to each section on GitHub.
optimize is a sequence of steps. Work through them one at a time and mark each one done as you go.
Step 1: setup
Use the setup-baseline skill. It builds the worktree and the workspace, has
extract-computation-graph write records/computation_graph.json and
records/execution_schedule.json, then measures the base commit for speed, memory and
correctness, profiles it in full with torch-profile, and records it with
workspace.py add --verdict base. diagnose begins the same way, which is why
that work lives in one skill and not in this one.
Setup can fail in a way worth handing back, and setup-baseline says so when it does. Stop there rather than arming a campaign on a baseline that did not hold.
Step 2: arm the loop
Arm once setup has passed, and from there the campaign runs until finish says
it is over.
python <plugin root>/tools/workspace.py arm <ws>
That records which session owns the campaign, read from CODEX_THREAD_ID
or CLAUDE_CODE_SESSION_ID. What keeps the loop turning depends on the
client you are in:
-
Claude Code. Call the CronCreate tool with cron
*/2 * * * *and this prompt, with the plugin root and<ws>filled in as absolute paths:Campaign watchdog. Run `python <plugin root>/tools/workspace.py finish <ws>`. If it exits non-zero, pick the optimization loop up where it stopped and keep going. If it passes, delete this job with CronDelete and stop.The job fires whenever the session is idle, so a turn that ends before the campaign is finished is picked up again within a couple of minutes. It lives in this session only, on no disk, invisible to every other session, and it expires after seven days.
-
Codex. Continue the optimization loop in the current turn. Before stopping, run
python <plugin root>/tools/workspace.py finish <ws>. If it reports outstanding work, address it and continue; do not stop merely to summarize progress. Stop when it passes, the user asks you to stop, or a blocker requires user input or an unavailable external resource. In that case, report what is blocked and what is needed to resume. No Stop hook is installed.
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.
- 17d ago First seen · 146 lines · 35 tokens per session scan A 9ffd4b6c13be
optimize is a skill published in the GitHub repository wenhaochai/claude-plugins (17 stars, last pushed 2d ago), licensed MIT. It adds 35 tokens to every session and 1,688 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-01.
Other skills, from other repositories
trace
Evidence-driven tracing lane that orchestrates competing tracer hypotheses in Claude built-in team mode.
smiles-validation
Strict SMILES validation, structural comparison, and modification verification. Catches invalid LLM-generated molecules.
nonlinear-solvers
Select and configure nonlinear solvers for f(x)=0 or min F(x). Use for Newton methods, quasi-Newton (BFGS, L-BFGS), Broyden, Anderson acceleration, diagnosing convergence issues, choosing line search vs trust region, and analyzing Jacobian quality.
linear-solvers
Select and configure linear solvers for systems Ax=b in dense and sparse problems. Use when choosing direct vs iterative methods, diagnosing convergence issues, estimating conditioning, selecting preconditioners, or debugging stagnation in GMRES/CG/BiCGSTAB.
numerical-stability
Analyze and enforce numerical stability for time-dependent PDE simulations. Use when selecting time steps, choosing explicit/implicit schemes, diagnosing numerical blow-up, checking CFL/Fourier criteria, von Neumann analysis, matrix conditioning, or detecting stiffness in advection/diffusion/reaction problems.
social-physics-filter
Unified boundary enforcement, interpersonal diagnostic, and relational audit engine. Absorbs 40 psychology + 2 social protocols and all relationship case studies.