Query Agent — Data & AI agent for Claude Code
Creates encapsulated, reusable query objects for complex database queries with composable scopes.
How to install Query Agent
Installs to ~/.claude/agents/thibautbaissac-rails_ai_agents-query-agent.md
mkdir -p ~/.claude/agents && curl -fsSL https://raw.githubusercontent.com/ThibautBaissac/rails_ai_agents/HEAD/.claude/agents/query-agent.md -o ~/.claude/agents/thibautbaissac-rails_ai_agents-query-agent.md Restart Claude Code, or start a new session, for it to be picked up.
What Query Agent does
name: query-agent description: Creates encapsulated, reusable query objects for complex database queries with composable scopes. Use when building reports, dashboards, aggregations, or when user mentions query objects, complex queries, or statistics. WHEN NOT: Simple one-liner queries that belong as model scopes, business logic (use service-agent), or data mutations (use service-agent). tools: [Read, Write, Edit, Glob, Grep, Bash] model: sonnet maxTurns: 30 permissionMode: acceptEdits memory
Alternatives in Data & AI
- Dex Data — Use this agent when dealing with data analysis, SQL queries, dashboards, visualizations, statistical analysis 523 ★
- Data Specialist — Senior data specialist covering exploratory analysis, statistical modeling, machine learning, experimentation 227 ★
- DB Perf Scanner — Scans codebase for database and storage performance issues including Firestore query patterns, GCS operations 160 ★
Full documentation available on GitHub
View Source RepositoryRelated Agents
Query Reviewer
Reviews Active Record queries for N+1, missing indexes, unscoped reads, aggregation done in Ruby instead of th
Presenter Agent
Creates presenter objects using SimpleDelegator for clean view formatting and display logic. Use when extracti
Monitor UI
Use this agent proactively whenever:\n- The user mentions monitoring, dashboards, metrics, or real-time data v
Migration Agent
Creates safe, reversible database migrations with proper indexes, constraints, and zero-downtime strategies. U
Database SQL Analyst
Use PROACTIVELY for SQL query optimization analysis - provides complex SQL query analysis, execution plan revi
Archive Crawler
Executes searches against ONE assigned archive, index or database and reports candidate hits. Spawned in paral
Related Skills
Snowflake Safe Query Skill
Write and run read-only Snowflake queries against the Gaiia reporting database under a four-layer safety guard
Generate Ddd
Generate DDD components. Creates entities, value objects, aggregates, commands, queries, repositories, domain
Mneo
Persistent memory for AI agents using git refs. MCP server + Claude Code skill. No vector database, no embeddi