optimizer

optimizer is an agent for Claude Code from komluk/scaffolding. It costs 35 tokens per session (1,666 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, 10 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, 10 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,666 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.01666
Opus 5.5 $0.00014 $0.00666
Sonnet 5.5 $0.00007 $0.00333
Haiku 4.5 $0.00003 $0.00167

Measured 1mo ago against content hash abf45dc43b7e, 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 1mo 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 · 185 lines

How it starts

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

Code exploration (graph -> LSP -> grep): for structure, dependency, impact, architecture or "where is X used" questions; skip for trivial single-file edits:

  1. Graph (mcp__graphify__*): start with graph_stats / god_nodes (skip if a "Project code graph" block is already in the prompt), then narrow query_graph calls (one symbol or module, token_budget <= 2000) and get_neighbors / shortest_path; broad questions come back truncated. If the graph is missing or stale, say so and fall back to grep.
  2. LSP for callers/references in typed code (TS, typed Python, Go…): locate the definition once (graph get_node, LSP workspaceSymbol, or one grep), then answer "who calls / where is X used" with LSP incomingCalls / findReferences — never grep for "X(" call sites. Also goToDefinition, documentSymbol (file outline). findReferences is mandatory before a rename, removal or signature change. In untyped JavaScript (no checkJs) LSP references are unreliable: use rg -n for callers there. If the LSP tool is unavailable or has no server for this language (or returns nothing for an obviously used symbol), fall back to rg -n / grep for callers and say that LSP was unavailable.
  3. grep/sed/cat via Bash only for literal text (strings, config keys, comments) and line ranges — not for call graphs in typed code. This rule overrides any generic "search with grep/find" guidance. Report real counts from tool results.

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

Read the full file on GitHub · 185 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. 1mo ago Changed abf45dc43b7e
  2. 1mo ago Changed · +3 lines 29a3d6ce515e
  3. 1mo ago Changed · +2 lines 0d62293e9a34
  4. 1mo ago Changed 83010c1d28d3
  5. 3mo 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 (16 stars, last pushed 8d ago), licensed MIT. It adds 35 tokens to every session and 1,666 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.

Related

optimizer compared with agents from other repositories

optimizer next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
optimizerkomluk/scaffoldingAgent168d agoMITA35Claude Code
customer-experiencecbrock84/headcountAgent2.6kyesterdayMITA30Claude Code
demand-generationcbrock84/headcountAgent2.6kyesterdayMITA30Claude Code
ai-visibility-analyzerakii-technologies-ltd/akii-seo-ai-search-optimizerAgent8019d agoMITA155Claude Code
system-design-orchestratorproyecto26/system-design-skillsAgent1501mo agoMITA395Claude Code
cad-verifier-xhighcrenshawdev/cadenceAgent11yesterdayMITA39Claude Code
cad-mapper-maxcrenshawdev/cadenceAgent11yesterdayMITA35Claude Code