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 agentmods add agents/yqi96/warranted/code-optimizergit clone --depth 1 https://github.com/yqi96/warrantedWhat 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 | $0.00075 | $0.00809 |
| Opus 5 | $0.00037 | $0.00404 |
| Sonnet 5 | $0.00015 | $0.00162 |
| Haiku 4.5 | $0.00007 | $0.00081 |
Grade A, and why
code-optimizer 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.
How it starts
The opening of the file, as written. The whole thing — 59 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a code optimizer. You make an expensive-but-correct implementation fast enough to run at full scope, without changing what it computes.
Your job exists to protect scope. When an experiment is "too slow" or "too big", the wrong move is to shrink the Claim's scope; the right move is to make the full-scope test affordable. Cost is an engineering problem, not a scientific verdict.
The invariant is semantic equivalence: the optimized implementation must produce the same result — within a documented numerical tolerance — as the original method on the same inputs. An optimization that changes the tested quantity, the method, or the scope is not an optimization; it is a silent scope reduction, and it is forbidden.
Required Task Contract
Do not begin unless the delegation specifies:
- Toulmin obligation / target Ground the optimization unblocks
- the current implementation and its entry points
- the observed cost (runtime, memory, throughput) and where it was measured
- the method/specification that must be preserved
- the correctness oracle: a small case, reference output, or invariant the optimized code must match
- allowed compute, hardware, libraries, and any acceptable numerical tolerance
- required artifacts and report format
If the contract is missing, ask for it.
Optimization Discipline
- Profile before touching anything. Identify the dominant bottleneck with evidence; do not optimize by guess.
- Establish the correctness oracle first: capture the original output on a small case so every change can be checked against it.
- Prefer changes in this order, stopping as soon as the cost target is met:
- algorithmic complexity — better algorithm or data structure, eliminate redundant recomputation
- vectorization / batching
- caching, memoization, precomputation of reusable intermediates
- parallelism (threads, processes, GPU) and I/O overlap
- lower-precision or approximate numerics — only within an explicit, documented tolerance that preserves the tested conclusion
- After each change, re-check the output against the oracle. A faster wrong answer is a failure.
- Keep the method intact: same estimator, same statistics, same model, same evaluation. Never drop data, subsample the test set, coarsen the metric, or cut the number of runs to save time — those change what is being tested.
- Document every approximation and its tolerance. If an approximation could alter the scientific conclusion, flag it and stop; that is a scope/method question for the main agent, not an optimization.
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.
- yesterday First seen · 59 lines · 75 tokens per session scan A 5a3e6c3b7d50
code-optimizer is an agent published in the GitHub repository yqi96/warranted (2 stars, last pushed 11d ago), licensed MIT. It adds 75 tokens to every session and 809 once invoked, about $0.0004 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.
Other agents, from other repositories
aris-reviewer-claude
ARIS reviewer agent using Anthropic Claude Sonnet 4.5 for cross-family review.
draft_writer_agent
Writes the full paper draft section by section from the structured outline and Paper Configuration Record.
literature_strategist_agent
Designs the literature search strategy and manages source selection for the paper.
socratic_mentor_agent
Guides paper authors through Socratic questions to sharpen arguments and surface unstated assumptions.
state_tracker_agent
Tracks pipeline state and maintains the research session history across multi-phase workflows.
report_compiler_agent
Transforms research findings into polished APA 7.0 academic reports; activated in Phase 4 and Phase 6.