_sections — Claude Code rule: performance optimization framework
A rule for Claude Code that defines eight performance optimization sections, ranks them by impact, and guides the agent in prioritizing code improvements. Install once, reference by ID when analyzing bottlenecks.
MIT ★ 7,191 updated 2026-10-24
.claude/rules/_sections.mdWhat _sections does
The rule structures optimization into a hierarchy: async waterfalls and bundle size are CRITICAL; server and client data fetching are HIGH or MEDIUM-HIGH; re-renders and rendering come next; JavaScript micro-optimizations and advanced patterns are LOW or LOW-MEDIUM. Each section includes a concise description of why it matters. Eliminating sequential awaits yields the largest gains. Reducing initial bundle size improves Time to Interactive and Largest Contentful Paint.
Drop the file into .claude/rules/_sections.md for Claude Code, .cursor/rules/_sections.mdc for Cursor, or .clinerules/_sections.md for Cline. The agent then references sections by ID (async, bundle, server, client, rerender, rendering, js, advanced) when identifying and prioritizing performance fixes.
What it helps with
- Establish a shared framework for performance optimization priorities
- Enable the agent to triage bottlenecks by impact level
- Align waterfalls, bundle, and rendering recommendations in one reference
- Distinguish between critical and marginal improvements
Example prompts for the agent
- Create a performance audit for this codebase using the _sections hierarchy, starting with async and bundle
- Which sections from _sections apply to this React component, and which matter most?
- Analyze this endpoint and tell me which _sections section is the biggest bottleneck
How to install _sections
Manually: put the files in place
.claude/rules/_sections.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/_sections.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/_sections.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/_sections.mdManually: put the files in place
.clinerules/_sections.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about _sections
How do I install _sections in Claude Code?
Place the file at .claude/rules/_sections.md in your project root. Claude Code will load it automatically on the next session.
What does _sections do?
It ranks eight performance optimization areas by impact: eliminating async waterfalls and reducing bundle size are critical; server and client data fetching are high-impact; re-render and rendering optimizations are medium; JavaScript tweaks and advanced patterns are low-impact. The agent uses it to prioritize fixes.
Does _sections work with IDEs other than Claude Code?
Yes. Use .cursor/rules/_sections.mdc for Cursor, .clinerules/_sections.md for Cline, .github/instructions/_sections.instructions.md for GitHub Copilot, and .devin/rules/_sections.md for Windsurf.
Source text
_sections.md · MIT
# Sections This file defines all sections, their ordering, impact levels, and descriptions. The section ID (in parentheses) is the filename prefix used to group rules. --- ## 1. Eliminating Waterfalls (async) **Impact:** CRITICAL **Description:** Waterfalls are the #1 performance killer. Each sequential await adds full network latency. Eliminating them yields the largest gains. ## 2. Bundle Size Optimization (bundle) **Impact:** CRITICAL **Description:** Reducing initial bundle size improves Time to Interactive and Largest Contentful Paint. ## 3. Server-Side Performance (server) **Impact:** HIGH **Description:** Optimizing server-side rendering and data fetching eliminates server-side waterfalls and reduces response times. ## 4. Client-Side Data Fetching (client) **Impact:** MEDIUM-HIGH **Description:** Automatic deduplication and efficient data fetching patterns reduce redundant network requests. ## 5. Re-render Optimization (rerender) **Impact:** MEDIUM **Description:** Reducing unnecessary re-renders minimizes wasted computation and improves UI responsiveness. ## 6. Rendering Performance (rendering) **Impact:** MEDIUM **Description:** Optimizing the rendering process reduces the work the browser needs to do. ## 7. JavaScript Performance (js) **Impact:** LOW-MEDIUM **Description:** Micro-optimizations for hot paths can add up to meaningful improvements. ## 8. Advanced Patterns (advanced) **Impact:** LOW **Description:** Advanced patterns for specific cases that require careful implementation.
© tech-leads-club · MIT · tech-leads-club/agent-skills