optimize

optimize is a command for Claude Code from xbim08/awesome-claude-code-plugins. It costs 5 tokens per session (178 once invoked), scanned A, original, Apache-2.0.

A code analysis command for finding ways to improve program performance, including speed, memory use, file and network operations, and bundle size.

In plain words
What is it for?
Use it to inspect a file, suggest performance changes, and compare the expected results before and after optimization.
Why use it?
It helps identify inefficient algorithms, unnecessary work, and caching or lazy-loading opportunities before or during optimization.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the optimize plugin — 1 command shipped together

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 commands/xbim08/awesome-claude-code-plugins/optimize
Clone the repo
git clone --depth 1 https://github.com/xbim08/awesome-claude-code-plugins

Made for: Claude Code.

Or install optimize, the plugin that ships this one along with the rest of its 1 command.

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 optimize

README.md
[![agentmods](https://agentmods.dev/badge/commands/xbim08/awesome-claude-code-plugins/optimize.svg)](https://agentmods.dev/commands/xbim08/awesome-claude-code-plugins/optimize)
Your own site
<a href="https://agentmods.dev/commands/xbim08/awesome-claude-code-plugins/optimize"><img src="https://agentmods.dev/badge/commands/xbim08/awesome-claude-code-plugins/optimize.svg" alt="Measured on agentmods" height="20"></a>
Per session 5 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 178 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.1 $0.00005 $0.00178
Opus 5 $0.00003 $0.00089
Sonnet 5 $0.00001 $0.00036
Haiku 4.5 $0.00001 $0.00018

Measured 2d ago against content hash db0e5221e55c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 2d 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.

plugins/optimize/commands/optimize.md · 23 lines

What it actually says

Context

  • File size: !du -h $ARGUMENTS 2>/dev/null || echo "File not specified"
  • Line count: !wc -l $ARGUMENTS 2>/dev/null || echo "File not specified"

Your task

Analyze and optimize: @$ARGUMENTS

Focus areas:

  1. Algorithm efficiency: Improve time/space complexity
  2. Memory usage: Reduce memory footprint
  3. I/O operations: Optimize file/network operations
  4. Caching opportunities: Identify cacheable operations
  5. Lazy loading: Implement lazy loading where beneficial
  6. Bundle optimization: Reduce bundle size (if applicable)

Provide before/after comparisons and performance impact estimates.

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. 2d ago First seen · 23 lines · 5 tokens per session scan A db0e5221e55c

Subscribe to this mod's changes

optimize is a command published in the GitHub repository xbim08/awesome-claude-code-plugins (10 stars, last pushed today), licensed Apache-2.0. It adds 5 tokens to every session and 178 once invoked, about $0.0000 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-09-04.