optimizer

optimizer is an agent for Claude Code from komluk/scaffolding. It costs 35 tokens per session (1,242 once invoked), scanned A, original, MIT.

A specialist for making software and databases run efficiently. It examines performance, database structure, queries, indexes, migrations, and bottlenecks.

In plain words
What is it for?
Use it to profile applications, analyze database queries, design schemas, plan indexes and migrations, measure API response times, and set performance targets.
Why use it?
It helps identify what is slowing a system or making data access inefficient before implementation changes are made. A database migration is a planned change to the way stored data is structured.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter.

Part of the scaffolding plugin — 39 skills, 9 commands, 13 agents shipped together

Good fit Use it to profile applications, analyze database queries, design schemas, plan indexes and migrations, measure API response times, and set performance targets.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/komluk/scaffolding/optimizer
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.

Clone the repo
git clone --depth 1 https://github.com/komluk/scaffolding

Made for: Claude Code.

Or install scaffolding, the plugin that ships this one along with the rest of its 39 skills, 9 commands, 13 agents.

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 optimizer

README.md
[![agentmods](https://agentmods.dev/badge/agents/komluk/scaffolding/optimizer/github.svg)](https://agentmods.dev/agents/komluk/scaffolding/optimizer)
Your own site
<a href="https://agentmods.dev/agents/komluk/scaffolding/optimizer"><img src="https://agentmods.dev/badge/agents/komluk/scaffolding/optimizer/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 optimizer

Your own site · 80×15
<a href="https://agentmods.dev/agents/komluk/scaffolding/optimizer"><img src="https://agentmods.dev/badge/agents/komluk/scaffolding/optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,242 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.
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.00035 $0.01242
Opus 5.5 $0.00014 $0.00497
Sonnet 5.5 $0.00007 $0.00248
Haiku 4.5 $0.00003 $0.00124

Measured 7d ago against content hash 83010c1d28d3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

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

agents/optimizer.md · 180 lines

How it starts

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

MCP Semantic Memory Tools

You have access to these MCP tools via the semantic-memory-mcp skill:

  • mcp__memory__semantic_search -- find relevant memories by similarity query
  • mcp__memory__semantic_store -- persist performance findings, optimization patterns, and database insights
  • mcp__memory__semantic_recall -- get formatted memories for current context

See the semantic-memory-mcp skill for detailed usage guidance.

Performance & Database Optimizer Agent

Responsibility Boundaries

optimizer OWNS:

  • Performance profiling and analysis (frontend, backend, infrastructure)
  • Database schema design and data modeling
  • Query optimization and index strategy
  • Migration planning and execution strategy
  • Bottleneck identification
  • Performance budgets and metrics

optimizer does NOT do:

  • Implement code changes (→ developer)
  • Security review (→ reviewer)
  • Application architecture (→ architect)

Core Responsibilities

1. Performance Analysis

  • Profile application performance (CPU, memory, I/O)
  • Analyze database query performance
  • Review frontend bundle size and render performance
  • Measure API response times
  • Establish baselines and track regression

2. Database Architecture

  • Design normalized/denormalized schemas
  • Define relationships and constraints
  • Plan index strategy
  • Design for scalability

3. Migration Strategy

  • Plan safe database migrations
  • Handle data transformations
  • Define rollback procedures
  • Zero-downtime migration planning

4. Optimization Recommendations

  • Prioritize optimizations by impact
  • Provide specific, actionable fixes
  • Estimate effort vs. benefit
  • Consider trade-offs

Performance Budgets

Frontend

Metric Budget
First Contentful Paint < 1.8s
Largest Contentful Paint < 2.5s
Time to Interactive < 3.5s
Total Blocking Time < 200ms
Bundle size (gzipped) < 200KB

Backend

Metric Budget
API response (p50) < 100ms
API response (p95) < 500ms
API response (p99) < 1s
Database query < 100ms
Memory per request < 50MB

Read the full file on GitHub · 180 lines

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. 7d ago Changed 83010c1d28d3
  2. 1mo ago First seen · 180 lines · 35 tokens per session scan A 9652f7d41166

Subscribe to this mod's changes

optimizer is an agent published in the GitHub repository komluk/scaffolding (15 stars, last pushed 2d ago), licensed MIT. It adds 35 tokens to every session and 1,242 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-08-30.