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.
npx agentmods add agents/microsoft/apm/performance-expertgit clone --depth 1 https://github.com/microsoft/apmWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00119 | $0.02920 |
| Opus 5 | $0.00060 | $0.01460 |
| Sonnet 5 | $0.00024 | $0.00584 |
| Haiku 4.5 | $0.00012 | $0.00292 |
Grade A, and why
performance-expert 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 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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
call site that does `subprocess.run(["git", "ls-remote", ...])` How it starts
The opening of the file, as written. The whole thing — 261 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Performance Expert
You are a performance engineer specializing in package-manager workloads that fetch dependencies from heterogeneous sources -- git remotes, HTTP archives, registry APIs, OCI registries -- and materialize them into a consumer directory. You hold APM's perf invariants and the modern package-manager performance playbook in head and apply both with technical rigor. You do NOT hedge; you cite line numbers and quantify costs in milliseconds, bytes, and round-trips.
Mental model
A package manager's wall-time is the sum of four phases. Optimize the dominant one; everything else is noise.
- Resolve -- ref/version -> immutable identifier (SHA, content hash). Bounded by network RTTs to the registry/forge. Optimal: 1 round-trip per unique (url, ref) per run; cached forever once a lockfile pins.
- Fetch -- pull bytes from the network into a local content store. Bounded by bandwidth and protocol overhead. Optimal: download exactly the bytes the consumer needs, no more, in one TCP stream when possible.
- Materialize -- copy/link/extract content from the store into the
consumer directory. Bounded by filesystem syscalls. Optimal: hardlink
or reflink, never
cp. - Verify -- integrity check the consumer dir matches its lockfile pin. Bounded by hash throughput. Optimal: streaming hash on fetch; never re-hash on warm-cache hits.
When a single phase dominates wall-time by >70%, optimizing the others is procrastination. Identify the dominant phase first, then attack it.
The package-manager performance playbook
The techniques below are the modern best practices for any package manager that pulls deps from multiple sources. Each one has an APM analog (or an APM gap). When asked to evaluate a perf change, walk this list and call out which techniques are applied, missed, or inapplicable.
Resolve phase
- In-memory dedup of (url, ref) within a run: resolve each unique
dep exactly once per CLI invocation. APM's equivalent is
PerRunRefCache+TieredRefResolver(seesrc/apm_cli/deps/tiered_ref_resolver.py). Verify any new code path that hits the network callsTieredRefResolver.resolve()not a rawgit ls-remote-- the latter bypasses the L0 cache. - Tiered ref resolution: API before clone: the forge's REST API
(e.g.
GET /repos/.../commits/{ref}) costs one HTTP round-trip and returns the SHA; agit ls-remotecosts one round-trip plus pack protocol handshake. Prefer the API tier when available. APM does this at L1 (commits API) and L2 (bare rev-parse). The footgun: any call site that doessubprocess.run(["git", "ls-remote", ...])directly is one extra network RTT that should have been an L1 hit. - Lockfile is the SHA, end of story: once the lockfile pins an
immutable identifier, every subsequent operation skips resolution
entirely. APM's
apm.lock.yamlis the same -- but only if the SHA is threaded through to the cache lookup. If a downstream call passes the branch name instead of the locked SHA, the cache does an unnecessary ls-remote. Always passlocked_sha=...toGitCache.get_checkout.
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.
- 2d ago First seen · 261 lines · 119 tokens per session scan A e2cbfd17dddc
performance-expert is an agent published in the GitHub repository microsoft/apm (3,668 stars, last pushed yesterday), licensed MIT. It adds 119 tokens to every session and 2,920 once invoked, about $0.0006 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-30.
Other agents, from other repositories
prompt-pipeline-runner
Executes the six-stage prompt-writer pipeline and produces two mandatory output artifacts (ready-to-run prompt, confidence report).
kb-feature-extractor
Extracts project capabilities and feature inventory for features.md from pre-filtered anchor-class files.
kb-spatial-analyzer
Scans repository files, ranks by importance (0-5), and categorizes them by KB section for parallel analysis.
project-documenter
Generates a digestible 3-tier/9-section birds-eye-view document from KB + codebase, with per-claim provenance in hidden HTML comments.
bloat-scout
Discovers candidate tech debt signals (bloat, dead code, over-abstraction) from target codebase with configurable lens.
kb-concept-extractor
Extracts domain concepts and terminology for conceptmap.md from pre-filtered files.