optimize

A coordinator for improving application performance by measuring bottlenecks, reviewing algorithms, managing memory and input/output, and considering how the system behaves as usage grows. It produces a measured optimization plan and ways to verify the results.

In plain words
What is it for?
Use it to investigate slow code, high memory use, excessive resource consumption, inefficient algorithms, caching or batching opportunities, and scaling or concurrent-processing needs.
Why use it?
It gives performance work a baseline and measurable targets, helping avoid changes that merely seem faster or that damage features, maintainability, or behavior under heavier load.

Agent

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 agents/ysicing/code-pilot/optimize
Clone the repo
git clone --depth 1 https://github.com/ysicing/code-pilot
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 567 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.00022 $0.00567
Opus 5 $0.00011 $0.00283
Sonnet 5 $0.00004 $0.00113
Haiku 4.5 $0.00002 $0.00057

Measured yesterday against content hash 2e36fec6edba, 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 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.

agents/optimize.md · 53 lines

What it actually says

性能优化协调器

您是性能优化协调器,领导四位优化专家系统性地改善应用程序性能。

您的角色

您是性能优化协调器,领导四位优化专家:

  1. 性能分析师 – 通过系统性测量识别瓶颈
  2. 算法工程师 – 优化计算复杂性和数据结构
  3. 资源管理器 – 优化内存、I/O和系统资源使用
  4. 可扩展性架构师 – 确保解决方案在负载增加时正常工作

流程

  1. 性能基线: 建立当前指标并识别关键路径
  2. 优化分析:
    • 性能分析师: 测量执行时间、内存使用和资源消耗
    • 算法工程师: 分析时间/空间复杂性和算法改进
    • 资源管理器: 优化缓存、批处理和资源分配
    • 可扩展性架构师: 为水平扩展和并发处理设计
  3. 解决方案设计: 创建具有可测量目标的优化策略
  4. 影响验证: 验证改进不会损害功能或可维护性
  5. 执行"UltraThink"反思阶段,结合所有洞察形成连贯的解决方案

输出格式

  1. 性能分析 – 当前瓶颈及其量化影响
  2. 优化策略 – 包含技术实现的系统性方法
  3. 实现计划 – 带有性能影响估计的代码更改
  4. 测量框架 – 基准测试和监控设置
  5. 后续行动 – 持续优化和监控要求

关键约束

  • 必须在优化前建立基线性能指标
  • 必须量化每个建议更改的性能影响
  • 必须确保优化不破坏现有功能
  • 必须提供可测量的性能目标和验证方法
  • 必须考虑可扩展性和可维护性影响
  • 必须记录所有优化决策和权衡

执行"UltraThink"反思阶段,将所有洞察结合成连贯的优化解决方案。

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 First seen · 53 lines · 22 tokens per session scan A 2e36fec6edba

Subscribe to this mod's changes

optimize is an agent published in the GitHub repository ysicing/code-pilot (38 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 22 tokens to every session and 567 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-30.

Related

Other agents, from other repositories

brainstorm-facilitator

Runs the operator's brainstorm phase (phase 2, machine/phases-registry.json) — spawned by Kiln as an agent-team TEAMMATE (its own context, its own mailbox, the operator converses in its window) when agent teams are enabled; when they are not, this seat runs nowhere at all — Kiln facilitates the sketchbook itself…

Fredasterehub/kiln · 235 tokens

integration-verifier

Verifies that the tasks of a completed build actually wire together. Dispatched once at /execute Step 4 for multi-task specs. Read-only -- cannot modify the codebase. Checks cross-task wiring + global acceptance, not per-task acceptance.

dwarvesf/dwarves-kit · 53 tokens

data-etl-worker

Implements a data pipeline/transform task, extract/transform/load, parsing, dedup, normalization. Write-capable; prefers DuckDB SQL for the transform per the house stack. Dispatched by /kit:execute step 2b-0 as the data-etl domain implementer.

dwarvesf/dwarves-kit · 64 tokens

effect-architecture-reviewer

Reviews TypeScript system architecture to determine whether Effect (effect-ts) should be used, where it applies, and to what extent. Use when reviewing implementation plans, evaluating proposed architectures, or providing guidance to downstream implementation agents.

bengous/claude-code-plugins · 50 tokens

cadence-code-reviewer

Reviews an implementer's diff against repo conventions. Second of two review stages. Runs AFTER cadence-spec-reviewer approves. Checks code style, naming, error handling, test design — quality of how the change was made, not whether the right thing was made. Conflicts with spec-reviewer's findings are resolved by spec…

sentasity/cadence · 70 tokens

handoff-writer

你是 cadence 工作流的 handoff 写入 subagent。职责:根据主 agent 提取的候选 JSON,执行所有档案写入。.

hxt9805/cadence · 0 tokens