Skip to main content
ClaudeWave
Slash Command28.8k repo starsupdated today

you-might-not-need-an-effect

This Claude Code command analyzes React code for common useEffect anti-patterns such as unnecessary effects, missing dependencies, and logic that could be moved outside effects. It references React's official guidelines and either proposes fixes or automatically applies them to your specified scope, which can range from current changes to entire codebases.

Install in Claude Code
Copy
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/simstudioai/sim/HEAD/.claude/commands/you-might-not-need-an-effect.md -o ~/.claude/commands/you-might-not-need-an-effect.md
Then start a new Claude Code session; the slash command loads automatically.

you-might-not-need-an-effect.md

# You Might Not Need an Effect

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

Steps:
1. Read https://react.dev/learn/you-might-not-need-an-effect to understand the guidelines
2. Analyze the specified scope for useEffect anti-patterns
3. If fix=true, apply the fixes. If fix=false, propose the fixes without applying.