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 ★
- Controller Agent — Creates thin, RESTful Rails controllers with strong parameters, proper error handling, and request specs 652 ★
- Command Helper — Smart command assistant that understands user intent and suggests relevant commands 587 ★
Full documentation available on GitHub
View Source RepositoryRelated Agents
Rails Implementer
Use this agent to implement an APPROVED plan phase in the MDM connector — Ruby models, services, jobs, GraphQL
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
Threejs Physics Collision
Master of physics and spatial queries in three.js — Rapier, Jolt and Ammo integration, collider generation fro
Jobs Reviewer
Reviews Rails background jobs for enqueue-inside-transaction races, non-serializable arguments, unsafe retries
Related Skills
Rails AI Context
45 MCP tools that give AI coding agents ground truth about your Rails app: schema, models, routes, controllers
Claude Sessions Duckdb
Query your Claude Code session transcripts with SQL — one DuckDB script, five views, and the format traps that
Bug Hunt
Adversarial bug hunt with 3 isolated agents — Hunter finds bugs, Skeptic challenges them, Referee gives final