performance-patterns

A guide to detecting and resolving performance problems in native C and C++ programs on Windows, Linux, WSL, and NVIDIA CUDA systems. CUDA is the technology used to run suitable work on NVIDIA graphics processors.

In plain words
What is it for?
Optimizing or diagnosing CPU and CUDA code with tools such as profilers, performance counters, flame graphs, and NVIDIA analysis utilities.
Why use it?
It helps identify whether slow execution comes from a known code pattern, the CPU, the GPU, the compiler, or the platform and profiling tools. The relevant investigation steps depend on the operating system and hardware.

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

Made for: Claude Code, Codex.

Per session 213 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,519 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.00213 $0.01519
Opus 5 $0.00106 $0.00759
Sonnet 5 $0.00043 $0.00304
Haiku 4.5 $0.00021 $0.00152

Measured yesterday against content hash 03def9e54eb6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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

The scan reads SKILL.md. This mod also ships 3 executable files (patterns/tests/run-mutex-to-rwlock-bench.ps1, scripts/collect-perf-env.ps1, scripts/collect-perf-env.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/performance-patterns/SKILL.md · 129 lines

How it starts

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

Performance patterns skill

A growing catalog of well-known code patterns that cause performance problems, with detection signals and resolution playbooks for each. The core pattern catalog focuses on x86 CPU code, with platform routing for Windows, WSL Linux, native Linux, and CUDA/NVIDIA environments.

The optimization knowledge is portable where the hardware is the same. What changes by platform is the mechanics: profiler vocabulary, compiler flags, debug-info format, synchronization primitives, CPU feature detection, and whether the bottleneck is CPU host code or CUDA device work.


Step 0 — Route the platform

If the user mentions WSL, Linux, CUDA, NVIDIA, GPU, Nsight, driver/toolkit mismatch, containers, or the platform is unclear, read references/platform-routing.md first.

Then load the platform-specific reference:

Platform / symptom Read
Windows native C/C++ CPU performance PORTING-NOTES.md
WSL Linux CPU performance references/wsl-linux.md, then references/linux-native.md
Native Linux CPU performance references/linux-native.md
CUDA/NVIDIA setup or GPU performance references/cuda.md

Use scripts/collect-perf-env.ps1 on Windows and scripts/collect-perf-env.sh inside WSL/native Linux when the environment is the problem or the user has not provided enough toolchain/profiler context.


How to use this skill

Step 1 — Load the right file for your context

Context Read this file
You have profiling output (VTune, AMD uProf, ETW/WPA, perf, flamegraph, Nsight summary, etc.) triggers/from-profile.md
You are reading existing source code and have no profiling data yet triggers/from-source.md
You are writing new performance-sensitive C/C++ or SIMD code guidelines/new-code.md

The trigger files cover all the same patterns; they are separated so you only load what is relevant. guidelines/new-code.md is a write-time checklist — load it instead of a trigger file when generating new code, not reviewing it.

Read the full file on GitHub · 129 lines

Files

What ships with it

37 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday First seen · 129 lines · 213 tokens per session scan A 03def9e54eb6

Subscribe to this mod's changes

performance-patterns is a skill published in the GitHub repository 2233admin/performance-patterns-skill (2 stars, last pushed 1mo ago), licensed MIT. It adds 213 tokens to every session and 1,519 once invoked, about $0.0011 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.

Related

Other skills, from other repositories

linux-phone-porting

Use for every hardware bring-up / debug session when porting mainline Linux to a phone. Enforces evidence-first debugging - capture device logs, then research across mainline, the vendor kernel, postmarketOS, Halium/UBports, Mobian and NixOS - before writing or flashing any fix. Requires an already-unlocked…

angelwzr/linux-phone-porting · 83 tokens

analyzing-linux-kernel-rootkits

Detect kernel-level rootkits in Linux memory dumps using Volatility3 linux plugins (checksyscall, lsmod, hiddenmodules), rkhunter system scanning, and /proc vs /sys discrepancy analysis to identify hooked syscalls, hidden kernel modules, and tampered system structures.

autohandai/community-skills · 65 tokens

analyzing-linux-elf-malware

Analyzes malicious Linux ELF (Executable and Linkable Format) binaries including botnets, cryptominers, ransomware, and rootkits targeting Linux servers, containers, and cloud infrastructure. Covers static analysis, dynamic tracing, and reverse engineering of x8664 and ARM ELF samples. Activates for requests involving…

autohandai/community-skills · 88 tokens

nemoclaw-contributor-implement-issue

Implement an accepted NemoClaw GitHub issue in the current checkout. Use when a user asks to pick up an issue for implementation, implement or fix a named issue, or add the issue's tests. Confirm accepted scope, deliver the smallest independently valuable capability slice, and record validation and remaining gates…

NVIDIA/NemoClaw · 134 tokens

kl-consistency-test

Write, calibrate, and debug the prefill-vs-decode logprob (KL) consistency tests in sglang -- the two independent conditions a zero requires (every operator batch-invariant, and the two paths computing the same function), which helper separates them, how to pick a threshold once they hold, and how to localize a…

sgl-project/sglang · 108 tokens

analyzing-linux-kernel-rootkits

Detect kernel-level rootkits in Linux memory dumps using Volatility3 linux plugins (checksyscall, lsmod, hiddenmodules), rkhunter system scanning, and /proc vs /sys discrepancy analysis to identify hooked syscalls, hidden kernel modules, and tampered system structures.

mukul975/Anthropic-Cybersecurity-Skills · 65 tokens