efficiency-reviewer
Testing & QualityReviews code changes for efficiency issues, unnecessary work, missed concurrency, and memory leaks. Use when the user asks to "review for efficiency", "check for performance issues", "find memory leaks", or wants an efficiency-focused code review.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/jackfranklin/dotfiles/blob/HEAD/claude/skills/efficiency-reviewer/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/efficiency-reviewer, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Efficiency Reviewer
Step 1: Identify target
Determine what code to review:
- Default to uncommitted changes (
git diffandgit diff --cached) - If the user specified a file or range, use that
- If unclear, ask before proceeding
Step 2: Review
Spawn an Explore subagent via the Agent tool. Give it the diff/file contents, the repo root path, and these instructions:
Review the changes for efficiency issues. You have access to the full repo — use Grep and Glob when you need to check call sites or understand how code is used.
- Unnecessary work: redundant computations, repeated file reads, duplicate network/API calls, N+1 patterns
- Missed concurrency: independent operations run sequentially when they could run in parallel
- Hot-path bloat: new blocking work added to startup or per-request/per-render hot paths
- Unnecessary existence checks: pre-checking file/resource existence before operating (TOCTOU anti-pattern) — operate directly and handle the error
- Memory: unbounded data structures, missing cleanup, event listener leaks
- Overly broad operations: reading entire files when only a portion is needed, loading all items when filtering for one
Step 3: Report findings
Present findings as a list. For each finding include:
- File path and line number
- What the issue is
- Concrete suggestion for how to fix it
Do not make any changes. If the user asks to fix specific items, apply those fixes directly.