list-performance-callbacks — Claude Code rule for lists
list-performance-callbacks is a Claude Code rule for passing event handlers to list items. It applies when callbacks are used inside a list.
AGPL-3.0 ★ 88 updated 2026-11-17
.claude/rules/list-performance-callbacks.mdWhat list-performance-callbacks does
The rule places one handler at the list level and passes it to the items, which provide their own identifiers when calling it. This avoids creating a separate function inside renderItem on each render.
Its example uses useCallback. The guidance covers callbacks passed to list-item components; it does not describe a broader application-wide performance setup.
What it helps with
- pass an event handler to list items
- avoid creating a callback inside
renderItemon every render - use one handler with different item identifiers
Example prompts for the agent
- Apply list-performance-callbacks to the handlers for this list.
- Check where the callback for list items is created in
renderItem. - Refactor the list handlers to follow list-performance-callbacks.
How to install list-performance-callbacks
Manually: put the files in place
.claude/rules/list-performance-callbacks.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/list-performance-callbacks.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/list-performance-callbacks.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/list-performance-callbacks.mdManually: put the files in place
.clinerules/list-performance-callbacks.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about list-performance-callbacks
How do I install list-performance-callbacks in Claude Code?
Add the rule file at .claude/rules/list-performance-callbacks.md.
What does list-performance-callbacks do?
It advises creating a handler at the list level and passing it to items, which call it with their identifiers.
How does list-performance-callbacks apply to renderItem?
It advises against creating a callback inside renderItem on every render and instead passes the items one handler.