luislins

N Plus One Hunter — Development agent for Claude Code

Development community

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

Terminal
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

  1. 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 Repository