you-might-not-need-a-memo
This Claude Code slash command detects and fixes unnecessary useMemo and React.memo usage in React code by identifying seven common anti-patterns, including memoizing cheap computations, unstable dependency arrays, and cases where state relocation or component composition would be more effective. Use it when reviewing code for performance optimization opportunities to eliminate redundant memoization that adds complexity without measurable benefit.
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/simstudioai/sim/HEAD/.claude/commands/you-might-not-need-a-memo.md -o ~/.claude/commands/you-might-not-need-a-memo.mdyou-might-not-need-a-memo.md
# You Might Not Need a Memo Arguments: - scope: what to analyze (default: your current changes). Examples: "diff to main", "PR #123", "src/components/", "whole codebase" - fix: whether to apply fixes (default: true). Set to false to only propose changes. User arguments: $ARGUMENTS ## References Read before analyzing: 1. https://overreacted.io/before-you-memo/ — two techniques to avoid memo entirely ## Anti-patterns to detect 1. **State can be moved down instead of memoizing**: Move state into a smaller child so the slow component stops re-rendering without memo. 2. **Children can be lifted up**: Extract stateful part, pass expensive subtree as `children` — children as props don't re-render when parent state changes. 3. **useMemo on cheap computations**: Small array filters, string concat, arithmetic don't need memoization. 4. **useMemo with constantly-changing deps**: Deps change every render = useMemo does nothing. 5. **useMemo to stabilize props for non-memoized children**: If the child isn't wrapped in React.memo, stable references don't matter. 6. **React.memo on components that always receive new props**: Fix the parent instead. 7. **useMemo for derived state**: Just compute inline during render. ## Steps 1. Read the reference above 2. Analyze the specified scope for the anti-patterns listed above 3. If fix=true, apply the fixes. If fix=false, propose the fixes without applying.
Create a block configuration for a Sim integration with proper subBlocks, conditions, and tool wiring
Add a knowledge base connector for syncing documents from an external source
Add a code-defined table enrichment (registry entry) backed by a provider cascade, ensuring each provider tool has hosted-key support
Add hosted API key support to a tool so Sim provides the key when users don't bring their own. Use when adding hosted keys, BYOK support, hideWhenHosted, or hosted key pricing to a tool or block.
Add a complete integration to Sim (tools, block, icon, registration)
Add a new LLM model to apps/sim/providers/models.ts with specs verified against the provider's live API docs (no hallucination)
Create tool configurations for a Sim integration by reading API docs
Create webhook or polling triggers for a Sim integration