find-unused-css

find-unused-css is a command for Claude Code from rohitg00/awesome-claude-code-toolkit. It costs 0 tokens per session (291 once invoked), scanned A, original, Apache-2.0.

A command that finds CSS rules, variables, and duplicate declarations that are not used by the project's pages or components.

In plain words
What is it for?
Use it to inspect CSS, SCSS, styled components, CSS modules, and template references for removable rules.
Why use it?
It helps reduce stylesheet clutter and may reduce the amount of CSS sent to users, while accounting for dynamically applied classes.

Command for Claude Code

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

Part of the css-cleaner plugin — 2 commands shipped together

About the project

Awesome Claude Code Toolkit is a curated collection of extensions and configuration for Claude Code, including agents, skills, commands, plugins, hooks, rules, templates, MCP configurations, and companion apps. It is for Claude Code users who want ready-made workflows and integrations for different development tasks. The catalogue add-ons are selected components from this toolkit.

rohitg00/awesome-claude-code-toolkit · 2,587 stars · on GitHub

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/rohitg00/awesome-claude-code-toolkit/find-unused-css
Clone the repo
git clone --depth 1 https://github.com/rohitg00/awesome-claude-code-toolkit

Made for: Claude Code.

Or install css-cleaner, the plugin that ships this one along with the rest of its 2 commands.

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 find-unused-css

README.md
[![agentmods](https://agentmods.dev/badge/commands/rohitg00/awesome-claude-code-toolkit/find-unused-css.svg)](https://agentmods.dev/commands/rohitg00/awesome-claude-code-toolkit/find-unused-css)
Your own site
<a href="https://agentmods.dev/commands/rohitg00/awesome-claude-code-toolkit/find-unused-css"><img src="https://agentmods.dev/badge/commands/rohitg00/awesome-claude-code-toolkit/find-unused-css.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 291 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.1 $0.00000 $0.00291
Opus 5 $0.00000 $0.00146
Sonnet 5 $0.00000 $0.00058
Haiku 4.5 $0.00000 $0.00029

Measured 2d ago against content hash c0ef7fd157fd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

find-unused-css 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.

plugins/css-cleaner/commands/find-unused-css.md · 29 lines

What it actually says

/find-unused-css - Find Unused CSS

Identify CSS rules that are not used by any component or page.

Steps

  1. Scan all CSS, SCSS, and styled-component files in the project
  2. Extract all CSS selectors: classes, IDs, element selectors, attribute selectors
  3. Scan all HTML, JSX, TSX, and template files for referenced CSS classes
  4. Check JavaScript files for dynamically applied classes (classList, className)
  5. Account for CSS modules by checking module import usage
  6. Cross-reference selectors with their usage across all template files
  7. Identify selectors with zero references in any template or component
  8. Check for CSS custom properties (variables) that are defined but never used
  9. Detect duplicate CSS rules with identical properties
  10. Calculate unused CSS as a percentage of total CSS
  11. Report unused selectors with file path, line number, and selector name
  12. Estimate bundle size savings from removing unused CSS

Rules

  • Account for dynamic class generation (template literals, classnames library)
  • Do not flag global reset styles or normalize.css as unused
  • Check for CSS used in third-party component overrides
  • Consider media query variants of the same class
  • Exclude CSS-in-JS runtime styles from static analysis
  • Flag utility classes only if no utility framework (Tailwind) is configured
  • Report confidence level for each unused selector finding
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 · 29 lines · 0 tokens per session scan A c0ef7fd157fd

Subscribe to this mod's changes

find-unused-css is a command published in the GitHub repository rohitg00/awesome-claude-code-toolkit (2,587 stars, last pushed 3mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 291 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-09-03.