performance-tuning

performance-tuning is a skill for Claude Code, Codex from sawrus/agent-guides. It costs 0 tokens per session (380 once invoked), scanned A, original, MIT.

A set of practices for improving the speed of web interfaces. It covers browser loading metrics, JavaScript bundle size, rendering behavior, images, and fonts.

In plain words
What is it for?
Use it to optimize Core Web Vitals, split code into smaller loads, prevent avoidable component rerenders, and serve images and fonts efficiently.
Why use it?
It helps pages load faster and reduces unnecessary browser work, layout movement, and repeated rendering.

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

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/sawrus/agent-guides/performance-tuning.svg)](https://agentmods.dev/skills/sawrus/agent-guides/performance-tuning)
Your own site
<a href="https://agentmods.dev/skills/sawrus/agent-guides/performance-tuning"><img src="https://agentmods.dev/badge/skills/sawrus/agent-guides/performance-tuning.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 380 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.00000 $0.00380
Opus 5 $0.00000 $0.00190
Sonnet 5 $0.00000 $0.00076
Haiku 4.5 $0.00000 $0.00038

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

Security

Grade A, and why

performance-tuning 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 5d 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.

areas/software/frontend/skills/performance-tuning/SKILL.md · 59 lines

What it actually says

Skill: Frontend Performance Tuning

When to load

When optimizing Core Web Vitals, reducing bundle size, diagnosing render performance, or reviewing images/fonts.

Re-render Prevention

// Memoize expensive computations
const sorted = useMemo(
  () => [...items].sort((a, b) => a.name.localeCompare(b.name)),
  [items]
);

// Stable callback references
const handleClick = useCallback(() => doSomething(id), [id]);

// Memoize child components receiving object/function props
const ExpensiveList = React.memo(({ items, onSelect }: ListProps) => (
  // rendering
));

// ❌ Inline objects create new references every render
<MyComponent config={{ timeout: 3000 }} />
// ✅ Stable reference
const CONFIG = { timeout: 3000 };
<MyComponent config={CONFIG} />

Code Splitting (Mandatory)

const UserDashboard = lazy(() => import('./features/users/UserDashboard'));

<Suspense fallback={<PageSkeleton />}>
  <UserDashboard />
</Suspense>

Image Optimization Checklist

  • Explicit width and height to prevent CLS
  • WebP/AVIF via <picture> with JPG fallback
  • loading="lazy" for below-fold images
  • loading="eager" + fetchpriority="high" for LCP image

Bundle Analysis

npx vite-bundle-visualizer
Library Problem Solution
moment.js 300KB+ Replace with date-fns
lodash Full import Use lodash-es named imports
@mui/material Full import Path imports: @mui/material/Button
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. 5d ago First seen · 59 lines · 0 tokens per session scan A f8cb376edfc7

Subscribe to this mod's changes

performance-tuning is a skill published in the GitHub repository sawrus/agent-guides (17 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 380 tokens. 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-30.

Related

Other skills, from other repositories