react-performance-optimizer — Claude Code subagent: how it works
This subagent tracks down unnecessary renders, optimizes bundle chunking, and tunes Core Web Vitals in React apps. Useful when web pages lag during heavy UI updates.
npx claude-code-templates@latest --agent web-tools/react-performance-optimizerWhat react-performance-optimizer does
This subagent inspects client-side code and introduces React 18 concurrent mechanics. It moves heavy state updates into useTransition and defers values with useDeferredValue. Operating directly inside the project via Read, Write, Edit, Bash, and Grep, the agent reviews component hierarchies and updates build configurations.
Its optimization approach targets code splitting with Suspense, bundle sizing through webpack-bundle-analyzer, and list virtualization. To improve LCP, it injects asset preloading and prioritizes above-the-fold image loading. Many sample solutions rely on packages like react-window or lodash, which must be added to package.json to prevent import errors.
What it helps with
- eliminate UI freezes by applying useTransition to input searches
- virtualize lengthy DOM lists with react-window
- split application chunks and generate a bundle analysis report
- improve LCP scores by preloading critical fonts and hero images
Example prompts for the agent
- Audit the main dashboard component and apply code splitting to heavy chart widgets
- Configure Webpack Bundle Analyzer to save a static HTML report
- Refactor this list view with virtualization to prevent frame drops
How to install react-performance-optimizer
1claude-code-templates
npx claude-code-templates@latest --agent web-tools/react-performance-optimizer2Manually: put the files in place
.claude/agents/react-performance-optimizer.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/react-performance-optimizer.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/react-performance-optimizer.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about react-performance-optimizer
How to install react-performance-optimizer in Claude Code?
Run npx claude-code-templates@latest --agent web-tools/react-performance-optimizer or save the template directly into .claude/agents/react-performance-optimizer.md.
What does react-performance-optimizer do?
It audits React projects for slow component updates, cuts down bundle overhead, and adjusts assets to meet Core Web Vitals targets.
What tools does this subagent require?
It uses Read, Write, Edit, Bash, and Grep to search through files and apply performance modifications.