principle-performance

principle-performance is a skill for Claude Code from lugassawan/swe-workbench. It costs 92 tokens per session (1,612 once invoked), scanned A, original, MIT.

A guide to improving how quickly and efficiently software runs. It covers response time, throughput, algorithm choices, database access, caching, and measuring before changing code.

In plain words
What is it for?
Use it to find slow paths, avoid repeated database queries, choose suitable data structures, size caches, and compare performance before and after changes.
Why use it?
Intuition often targets the wrong bottleneck, and changes that improve one kind of speed can worsen another.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the swe-workbench plugin — 62 skills, 26 commands, 23 agents, 5 hooks shipped together

Good fit Use it to find slow paths, avoid repeated database queries, choose suitable data structures, size caches, and compare performance before and after changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lugassawan/swe-workbench/principle-performance
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.

Any agent
npx skills add lugassawan/swe-workbench --skill principle-performance
Clone the repo
git clone --depth 1 https://github.com/lugassawan/swe-workbench

Made for: Claude Code.

Or install swe-workbench, the plugin that ships this one along with the rest of its 62 skills, 26 commands, 23 agents, 5 hooks.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/lugassawan/swe-workbench/principle-performance/github.svg)](https://agentmods.dev/skills/lugassawan/swe-workbench/principle-performance)
Your own site
<a href="https://agentmods.dev/skills/lugassawan/swe-workbench/principle-performance"><img src="https://agentmods.dev/badge/skills/lugassawan/swe-workbench/principle-performance/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 principle-performance

Your own site · 80×15
<a href="https://agentmods.dev/skills/lugassawan/swe-workbench/principle-performance"><img src="https://agentmods.dev/badge/skills/lugassawan/swe-workbench/principle-performance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 92 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,612 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00092 $0.01612
Opus 5.5 $0.00037 $0.00645
Sonnet 5.5 $0.00018 $0.00322
Haiku 4.5 $0.00009 $0.00161

Measured 3mo ago against content hash 7826127784f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

principle-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 3mo 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.

skills/principle-performance/SKILL.md · 96 lines

How it starts

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

Performance

Performance bugs are design bugs. They are cheapest to fix before the first line of code is written. This skill teaches design-time discipline — choosing the right algorithm, data structure, and access pattern — not runtime profiler operation.

Latency vs Throughput

They pull in opposite directions; name the goal before optimizing.

  • Latency: time to serve one request. Throughput: requests served per unit time. Improving one often degrades the other.
  • Tail latency (p99, p999) is a separate budget from mean latency — do not let averages hide outliers.
  • Batching and buffering improve throughput at the cost of per-item latency; state this trade-off explicitly.
  • Choose the objective first: a real-time API and a batch pipeline have different success criteria.

Profile Before You Optimize

Measurement beats intuition; no fix without a hot path identified by data.

  • Identify the bottleneck with a profiler before changing code — optimizing a path that accounts for 5% of runtime cannot yield more than a 5% total improvement, no matter how perfect the fix.
  • Benchmark before and after each change; a "feels faster" claim is not evidence.
  • Most code is cold; optimize only the identified hot path. Premature optimization is applied to the wrong place.
  • A profile that surprises you is information; a profile you skipped is a bug waiting to be filed.

Big-O Where It Bites

Algorithmic complexity matters when N grows; the right abstraction is cheaper than any constant-factor tweak.

  • Nested loops over collections are O(n²) by default — verify that the outer N is bounded and small.
  • Membership tests on lists are O(n); use a hash set when the check is inside a loop.
  • String concatenation inside a loop builds O(n²) bytes; accumulate then join once outside the loop.
  • Sort once, query many times — precompute sorted order or indexes when access patterns allow.
  • Accidental quadratic is the most common performance regression; review any loop whose body touches a collection.

Read the full file on GitHub · 96 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. 3mo ago First seen · 96 lines · 92 tokens per session scan A 7826127784f9

Subscribe to this mod's changes

principle-performance is a skill published in the GitHub repository lugassawan/swe-workbench (3 stars, last pushed 2d ago), licensed MIT. It adds 92 tokens to every session and 1,612 once invoked, about $0.0004 per session on Opus 5.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-03.

Related

principle-performance compared with skills from other repositories

principle-performance next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
principle-performancelugassawan/swe-workbenchSkill32d agoMITA92Claude Code
code-forgetechygarg/latticeSkill219todayMITA81Claude Code
functions-developmentCrowdStrike/foundry-skillsSkill40yesterdayMITA124Claude Code
zogxobotyi/cc-foundrySkill232d agoMITB45Claude Code
dddzdanovichnick/dotnet-pilotSkill55d agoMITA36Claude Code
error-handlingzdanovichnick/dotnet-pilotSkill55d agoMITA36Claude Code
loggingzdanovichnick/dotnet-pilotSkill55d agoMITA29Claude Code