choosing-what-to-optimize

choosing-what-to-optimize is a skill for Claude Code from AleksandarBisevac/claude-plugins. It costs 145 tokens per session (2,309 once invoked), scanned A, original, MIT.

A measurement-based guide for deciding which parts of a code repository are worth making faster. It compares elapsed time, total processor work, and the steps that determine the overall runtime.

In plain words
What is it for?
It is for measuring test and tool runtime, identifying the true bottleneck, ranking optimisation targets, and deciding when the measured benefit is too small to justify the work.
Why use it?
It prevents developers from optimising code based only on guesses, import counts, or text searches when those may not reflect real performance.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 tools/sweep-selftests.py # wall clock: what you wait for.

Good fit It is for measuring test and tool runtime, identifying the true bottleneck, ranking optimisation targets, and deciding when the measured benefit is too small to justify the work.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/AleksandarBisevac/claude-plugins
agentmods
npx agentmods add skills/aleksandarbisevac/claude-plugins/choosing-what-to-optimize

Made for: Claude Code.

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 choosing-what-to-optimize

README.md
[![agentmods](https://agentmods.dev/badge/skills/aleksandarbisevac/claude-plugins/choosing-what-to-optimize/github.svg)](https://agentmods.dev/skills/aleksandarbisevac/claude-plugins/choosing-what-to-optimize)
Your own site
<a href="https://agentmods.dev/skills/aleksandarbisevac/claude-plugins/choosing-what-to-optimize"><img src="https://agentmods.dev/badge/skills/aleksandarbisevac/claude-plugins/choosing-what-to-optimize/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 choosing-what-to-optimize

Your own site · 80×15
<a href="https://agentmods.dev/skills/aleksandarbisevac/claude-plugins/choosing-what-to-optimize"><img src="https://agentmods.dev/badge/skills/aleksandarbisevac/claude-plugins/choosing-what-to-optimize.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 145 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,309 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00145 $0.02309
Opus 5 $0.00072 $0.01154
Sonnet 5 $0.00029 $0.00462
Haiku 4.5 $0.00015 $0.00231

Measured 11d ago against content hash 36572daec2ba, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

choosing-what-to-optimize scanned grade A with 1 finding 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 11d 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

subprocess.run([sys.executable, "tools/sweep-selftests.py"], capture_output=True)
.claude/skills/choosing-what-to-optimize/SKILL.md · 167 lines

How it starts

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

Choosing what to optimize

Everything here was paid for. The figures are from one pass over this repo's own test machinery, and every one of them carries the command that re-derives it, because a number in a document is a number that rots.

The short version: the repo has no cheap 20% lying around. What it has is a handful of suites doing real work against real git and real browsers. So the value of an optimization pass here is mostly in not doing the wrong one.

Measure the thing; do not grep for it

Three findings in one session were reported wrong, each because a grep stood in for a run:

claimed actual why the grep lied
38 subprocess calls in a suite 453 child processes the grep counted textual occurrences; most calls span lines and most spawns come from the code under test
1 tool without a test suite 3 all three printed a pointer containing --selftest, so the grep matched the word and missed the absence
0 section markers in an 8000-line file 42 the lint's own regex allows two spaces of indentation; the grep was anchored at column 0

The third was the expensive one: it was the premise of a plan. The lint would have passed on that file, so the rule being added to force a split would have forced nothing.

Ask the subject, not a proxy for it: run the profiler, call the lint function, count the processes. When a claim is about a rule, ask the rule — import the module and call it rather than reimplementing its pattern in a grep.

Three numbers, not one

"Slow" is three different measurements and they lead to three different decisions.

python3 tools/sweep-selftests.py             # wall clock: what you wait for
python3 tools/sweep-selftests.py --jobs 1    # the serial shape, for a bisect
# total child CPU: what a 2-core CI runner pays, since its wall clock is ~CPU/2
import resource, subprocess, sys, time
b = resource.getrusage(resource.RUSAGE_CHILDREN); t0 = time.time()
subprocess.run([sys.executable, "tools/sweep-selftests.py"], capture_output=True)
a = resource.getrusage(resource.RUSAGE_CHILDREN)
print(time.time() - t0, (a.ru_utime - b.ru_utime) + (a.ru_stime - b.ru_stime))

Read the full file on GitHub · 167 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. 11d ago First seen · 167 lines · 145 tokens per session scan A 36572daec2ba

Subscribe to this mod's changes

choosing-what-to-optimize is a skill published in the GitHub repository AleksandarBisevac/claude-plugins (4 stars, last pushed 2d ago), licensed MIT. It adds 145 tokens to every session and 2,309 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

party

Throw or join an agents-party: a shared channel where several AI agent sessions (and their humans) talk to each other — Claude Code, Cursor, Codex or any other agent, on one machine or across machines. Use when the user asks to throw or start a party, wants several agent sessions to collaborate in one chat, wants two…

1gr14/agents-party · 110 tokens

validate-album

Validates album directory structure, file locations, and content integrity. Use before release or whenever the user wants to check an album's structural health.

bitwize-music-studio/claude-ai-music-skills · 33 tokens

promote-idea

Converts an album idea from IDEAS.md into an actual album project in one step. Use when the user says "promote [idea title]", "turn idea into album", or "start working on [idea]".

bitwize-music-studio/claude-ai-music-skills · 50 tokens

import-art

Places album art files in the correct audio and content directory locations. Use when the user has generated or downloaded album artwork that needs to be saved.

bitwize-music-studio/claude-ai-music-skills · 32 tokens

plagiarism-checker

Scans lyrics for phrases that may match existing songs using web search and LLM knowledge. Use before release to check for unintentional borrowing.

bitwize-music-studio/claude-ai-music-skills · 35 tokens

cleanup

Clean up after a merged pull request — return to the base branch, remove the worktree, delete the branch, sweep other stale branches and worktrees, and report tracker state. Use after a merge or whenever asked what is left over.

mikestankavich/claude-ship-workflow · 0 tokens