Target

From melodic-software/claude-code-plugins · View interactive version

Target is an AI agent skill from the GitHub repository melodic-software/claude-code-plugins. Ranking of optimization targets by evidence quality, from session pain, a named path or telemetry, so an unmeasured system yields 'instrument this first' instead of a guess. Use when: 'what should we optimize', 'find the bottleneck', 'this feels slow', 'is X worth optimizing', 'our git hooks or CI c

How to use this skill

Skill file

Arguments. [<path|component|'session'|'telemetry'>]. e.g. /performance:target plugins/disk-hygiene/hooks

Purpose

Answers "what should we optimize, and how much do we actually know about it?"

Never pick a target because its mechanism sounds expensive. A diagnosis blaming WDAC

code-integrity enforcement for slow process spawns is wrong when the data says otherwise, even with

the policy enabled: a spread of min 180.5 ms / median 1107.7 ms / max 2841.3 ms across identical

no-op spawns is a contention signature, because a fixed policy check cannot produce a 15x spread.

The bimodality is the diagnosis; the plausible mechanism is a distraction.

Rank by evidence, and say so when there is none.

Inputs it accepts

| Source | What to do |

|---|---|

| The current session's own pain | Name the operation that felt slow and what was observed. A screenshot or recording counts. Anecdote is a valid candidate source and an invalid ranking basis. |

| A named path or component | Enumerate the layers it spans before choosing one (see "Measure the layers first"). |

| A telemetry store | /harness-ops:observability (if enabled) for Claude Code's own; otherwise the project's. Prefer it over every other source, after checking its accuracy and coverage. |

| Slow checks: git hooks, a local check script or CI jobs | Rank per check and lane (see "Slow checks, hooks and CI"). Claude Code's own hooks are the go-faster hooks area, not this row. |

| Open-ended "what is slow here" | The open-ended sweep belongs to /performance:go-faster; this skill ranks what that sweep, or the user, brings. With nothing brought, expect "instrument this first". |

Evidence tiers

Rank every candidate into exactly one. A lower tier never outranks a higher one, regardless of

how compelling the mechanism sounds.

| Tier | Means | Example |

|---|---|---|

| E1, attributed measurement | A measurement that isolates this component's cost from its neighbors' | A spawn census showing this hook costs 4 of the 7 spawns per tool call |

| E2, aggregate measurement | A real measurement that includes this component but does not isolate it | "The whole pre-tool path takes 1.2 s" |

| E3, structural inference | No measurement; a documented cost model predicts expense | "This is a 125-line shell wrapper that runs per tool call" |

| E4, suspicion | A plausible mechanism and nothing else | "WDAC is probably slowing spawns" |

Nothing above E3 exists means the top recommendation is "instrument this first", naming the

cheapest instrument that would reach E2. That is the answer; do not substitute a ranked guess.

Cheap instruments: a census of what runs on

the hot interaction, and events tagged with the

region and phase the symptom hits.

Measure the layers before choosing one

When a candidate spans layers (a wrapper script around a larger program; a request through a data

access layer through a driver), attribute cost across the layers before picking one to optimize.

Do not pick the largest layer by size: a 125-line wrapper can carry roughly 88% of the cost while

the 1903-line program it execs is not the bottleneck. Layer attribution is cheap and reorders the

candidate list.

Trace past the headline event too: work no metric covers (background reloads, idle-state work)

still costs. For a field report with a recording, follow the diagnosis ladder before theorizing.

See diagnose.

To name a candidate's mechanism, find the row of the profile-to-family table in

optimization patterns that

the evidence matches; a mechanism with no matching row is not named. A deletion candidate is the

exception: it comes from reading the path's callers, so it ranks E3 until a measurement covers it.

Slow checks, hooks and CI

A repository's checks run in lanes: a commit hook, a push hook, the pre-PR check (run once per

head before a pull request opens) and CI. Treat each lane as a layer and attribute before choosing.

  1. Inventory each check and its lane from the repository's hook-manager config, its check

scripts and its CI workflows. For hook timings, the git-hooks installer's read-only inspect

inventory, run through a format plugin's setup check inspect (if enabled), lists every hook

per stage and times the plugin's own entries. Read the repository's own placement record and budgets first (rules,

conventions, agent instructions); they override this skill. This repository's worked case is the

check-placement contract, Duration budgets;

borrow no number from it. With no recorded budget, setting one is /performance:goal's job.

  1. One candidate per check and lane, the lane named in the Candidate cell

(shell lint, pre-commit). A lane total is E2; one check timed alone in its lane is E1.

  1. The baseline is p50 and p90 per lane, on a named sample of changed files (one file, a

typical change, a large change), never a single run. /performance:goal records that list.

  1. Rank these moves per candidate, each at the tier its evidence earns:

it: CI stays the hard stop, whatever a local hook runs.

runner that returns only its last job's status passes a failed check. Confirm the shell's or

hook manager's exit semantics at run time.

everything.

  1. An upgrade or swap carries a dependency-collision check: every other tool that loads the one

being replaced or upgraded still resolves to a version that supports it, read from the package

manager's dependency tree before the change is proposed.

  1. Resolve stack specifics at run time: which faster tool exists, its cache and incremental

flags and the runner's parallel semantics come from /discovery:research (if enabled) and the repository's

own conventions, never from this skill.

A check that got faster because it checked nothing is broken, not fast. Before and after a

change, confirm each check reports the files it inspected; a zero-input pass is a finding.

Checks slow as the repository grows. Fill the Growing state column with the counter that grows

(files a check scans, test suites a change selects, checks per lane) and route it to

/toolchain:ratchet (if enabled), which holds a counter, never a duration.

Name the counter, not just the duration

For each ranked candidate, name the drift-immune counter that would settle it: process spawns,

syscalls, queries, allocations, bytes, round trips. A counter is reproducible on a host whose wall

clock is not.

The counter catalog lists

deterministic counters to try before timing. If no counter exists for a candidate, say so

explicitly: it changes what /performance:goal can promise.

Counts over wall clock is established practice only for instruction counts; extending it to

spawns, syscalls and queries is this plugin's own generalization. Present a counter as

reproducible, never as more truthful: the duration is what a user feels, and a counter stands

in for it only where the two move together.

Output

A ranked table, highest evidence tier first:

| Rank | Candidate | Tier | What is known | Counter that would settle it | Cheapest next instrument |

|---|---|---|---|---|---|

Add a Growing state column when the candidate reads state whose size grows with use (transcripts,

logs, histories, accumulating caches): yes — /performance:goal will require scaling arms or no.

When yes, name what grows and the smallest realistic span of sizes to measure (not a single point).

Then one line naming the recommended target and the tier it rests on. If that tier is E3 or E4, the

recommendation is to instrument, not to optimize.

On a re-scan after a MET result, look first for the next slow spot in the same journey or path.

Boundary

because it needs the floor computed and the realistic/ideal split agreed.

/performance:snapshot captures.

reproduction is a debugging task, not a candidate ranking.

already on disk goes to /debugging:analyze-profile (if enabled);

otherwise open it in the tool that recorded it. Either way, its finding enters this ranking as

E1 or E2 evidence.

/harness-ops:audit-performance (if enabled), which this skill consumes as a telemetry source rather than

duplicating.

Next

on an E3 or E4 candidate, or one this ranking says to instrument, until the named instrument has

run.

Related

Gotchas

the mechanism predicts, then check whether the data shows it. A fixed cost cannot produce a

variable spread.

candidate onto the list at E4 and no higher.

layers before believing size.

than discovering it in /performance:snapshot when a wall-clock claim gets refused.

/performance:goal does not settle on one transcript size while production grows without bound.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.