performance

A method for treating software efficiency as a measured requirement rather than a vague goal. It uses benchmarks, numeric limits, and checks that can block work when performance gets worse.

In plain words
What is it for?
Setting response-time or processing-time budgets, writing benchmark checks, and keeping optimizations local and maintainable.
Why use it?
It avoids guessing about speed and helps prevent future changes from quietly violating agreed performance limits.

Skill for Claude CodeCodex

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 skills/hecer/yoke/performance
Any agent
npx skills add HECer/yoke --skill performance
Clone the repo
git clone --depth 1 https://github.com/HECer/yoke

Made for: Claude Code, Codex.

Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 694 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 $0.00056 $0.00694
Opus 5 $0.00028 $0.00347
Sonnet 5 $0.00011 $0.00139
Haiku 4.5 $0.00006 $0.00069

Measured 2d ago against content hash 5d0916174098, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

performance 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.

canon/skills/performance/SKILL.md · 49 lines

How it starts

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

Performance (measured, not vibed)

"Efficient" is a requirement, not a code style. Untested performance claims rot exactly like untested behavior claims. This skill makes efficiency mechanical — the same move Yoke makes for everything else.

The decision ladder

  1. Default: clean + minimal. For ~90% of code, the minimal-code rules ARE the performance strategy — less code, fewer layers, no speculative abstraction. Do not micro-optimize code that no measurement flagged (premature optimization).
  2. Performance requirement? Make it an acceptance criterion. A number, not an adjective:
    • Good: "imports 1M rows in < 2s", "p95 request latency < 50ms in the bench test", "no allocation inside the render loop (verified by the bench assertion)"
    • Bad: "should be fast", "optimize the importer"
  3. Whole-project budget? Use the perf gate. Set perf.command in .yoke/config.yaml (a benchmark script; exit 0 = within budget). The loop runs it after verify — a story that breaks the budget is blocked, no matter how clean its diff is.

Writing efficient code that agents can maintain

  • Clean at the boundaries, aggressive in the leaves. Interfaces, data flow, and names stay simple and obvious. Optimization lives inside a few clearly-bounded leaf functions whose contracts are pinned by tests. An ugly-fast function is maintainable; an ugly-fast architecture is not.
  • Profile before optimizing. Find the actual hot 5% (a profiler, a timing harness, the bench script) — never optimize from intuition. Record the measurement in the PR/commit.
  • Benchmarks are tests. Commit them. An optimization without a committed benchmark is one refactor away from silently disappearing. The bench script doubles as perf.command.
  • Version the WHY. Every non-obvious optimization gets a one-line comment (perf: avoids N+1 — see bench/import.mjs) and, if it shaped a design, a line in context/DECISIONS.md. The most common AI maintenance accident is a later agent "simplifying" fast code back to slow because nothing said why it was shaped that way.
  • Know the classics before reaching for cleverness: right data structure (map vs list scan), batching over per-item round trips (N+1), streaming over buffering, avoiding repeated work in loops, caching only with a measured hit rate and an invalidation story.

Read the full file on GitHub · 49 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. 2d ago First seen · 49 lines · 56 tokens per session scan A 5d0916174098

Subscribe to this mod's changes

performance is a skill published in the GitHub repository HECer/yoke (2 stars, last pushed 11d ago), licensed MIT. It adds 56 tokens to every session and 694 once invoked, about $0.0003 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-08-31.