css-optimize

A command for finding and applying CSS performance improvements, including reducing the amount of styling code sent to browsers.

In plain words
What is it for?
Analyzing CSS size, unused rules, duplicate rules, complex selectors, render-blocking styles, critical CSS, and animation performance, then optimizing them.
Why use it?
It helps remove unused or repeated rules and identify styling that slows loading, rendering, or animations.

Command

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 commands/andronics/claude-plugin-css-pro/css-optimize
Clone the repo
git clone --depth 1 https://github.com/andronics/claude-plugin-css-pro
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,330 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.00011 $0.01330
Opus 5 $0.00005 $0.00665
Sonnet 5 $0.00002 $0.00266
Haiku 4.5 $0.00001 $0.00133

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

Security

Grade A, and why

css-optimize 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.

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.

commands/css-optimize.md · 245 lines

How it starts

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

CSS Performance Optimization

I'll analyze and optimize your CSS for better performance, smaller bundle size, and faster rendering.

Target Files

Optimizing: $ARGUMENTS

If no specific files provided, I'll optimize all CSS files in the project.

Optimization Strategy

Phase 1: Analysis

I'll first analyze your CSS to identify optimization opportunities:

  1. Bundle Size Analysis

    • Current size (uncompressed, minified, gzipped)
    • Unused CSS detection
    • Duplicate rule identification
    • Optimization potential calculation
  2. Performance Audit

    • Selector complexity analysis
    • Render-blocking detection
    • Critical CSS identification
    • Animation performance check
  3. Opportunity Assessment

    • Prioritize optimizations by impact
    • Estimate size savings
    • Calculate performance improvements

Phase 2: Optimization

Based on analysis, I'll apply these optimizations:

1. Remove Unused CSS
Tool: PurgeCSS / Manual analysis
Expected savings: 30-70% of bundle size

Actions:
- Scan HTML/JS/templates for used classes
- Remove unused rules
- Keep safelist patterns (dynamic classes)
2. Eliminate Duplicates
Expected savings: 5-15% of bundle size

Actions:
- Find duplicate rules
- Merge identical selectors
- Extract common patterns
3. Optimize Selectors
Performance impact: 20-50% faster style calculation

Actions:
- Reduce selector depth (max 3 levels)
- Remove universal selectors
- Simplify attribute selectors
- Flatten deeply nested rules
4. Minify & Compress
Expected savings: 60-80% with gzip

Actions:
- Remove whitespace and comments
- Shorten color values (#ffffff → #fff)
- Combine similar rules
- Optimize property values
5. Extract Critical CSS
Performance impact: 1-2s faster FCP

Actions:
- Identify above-the-fold styles
- Extract critical CSS (< 14KB)
- Set up async loading for remaining CSS
6. Optimize Animations
Performance impact: Smooth 60fps animations

Actions:
- Convert layout-triggering to transform/opacity
- Add will-change appropriately
- Remove/limit expensive properties

Read the full file on GitHub · 245 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. yesterday First seen · 245 lines · 11 tokens per session scan A 66574853a2ee

Subscribe to this mod's changes

css-optimize is a command published in the GitHub repository andronics/claude-plugin-css-pro (2 stars, last pushed 10mo ago), licensed MIT. It adds 11 tokens to every session and 1,330 once invoked, about $0.0001 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.