N Plus One Hunter — Development agent for Claude Code
Finds N+1 queries in Rails controllers, views, serializers and jobs and suggests includes, preload or eager_load.
How to install N Plus One Hunter
Installs to ~/.claude/agents/luislins-rails-claude-agents-n-plus-one-hunter.md
mkdir -p ~/.claude/agents && curl -fsSL https://raw.githubusercontent.com/luislins/rails-claude-agents/HEAD/.claude/agents/n-plus-one-hunter.md -o ~/.claude/agents/luislins-rails-claude-agents-n-plus-one-hunter.md Restart Claude Code, or start a new session, for it to be picked up.
What N Plus One Hunter does
name: n-plus-one-hunter description: Finds N+1 queries in Rails controllers, views, serializers and jobs and suggests includes, preload or eager_load. Use after adding views, JSON output or loops over associations. tools: Read, Grep, Glob
You find N+1 queries by reading code. You do not run the app and you never edit files.
Steps
- Scope. If the prompt names files, start there. Otherwise, use Glob for
app/controllers/**/*.rb,app/views/**/*.erb,app/serializers/**/*.rb, `app
Alternatives in Development
- Cross Linker — Scan recent or specified notes for missing wikilinks 4.6k ★
- Agent Refactorer — Principal Clean Code Specialist specializing in code simplification, performance tuning, and refactoring loops 957 ★
- Controller Agent — Creates thin, RESTful Rails controllers with strong parameters, proper error handling, and request specs 652 ★
Full documentation available on GitHub
View Source RepositoryRelated Agents
UIKit Expert
Tier 2 — Implementation. Owns programmatic UIKit views, MVP contracts, presenters, and navigation. Use for bui
Model Agent
Creates well-structured ActiveRecord models with validations, associations, scopes, and callbacks. Use when cr
Rails Reviewer
Reviews changed Rails code for dangerous callbacks, logic in controllers, fat models, ActiveRecord misuse and
Stimulus Agent
Creates accessible Stimulus controllers following Hotwire patterns with targets, values, and actions. Use when
Component Reviewer
Expert component reviewer for Claude Code Templates. Use PROACTIVELY when adding or modifying components in cl
Django API
Use this agent PROACTIVELY when building REST API features with Django REST Framework. This includes creating
Related Skills
Rails AI Context
45 MCP tools that give AI coding agents ground truth about your Rails app: schema, models, routes, controllers
Hook Intel Skill
Build a living database of proven viral hooks from your competitors. It scrapes their Instagram every week, fi
Android Layout Inspector MCP
Spatial inspection of a live Android UI for AI agents — finds overlapping views, clipping, touch targets under