Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/oliver-kriska/claude-elixir-phoenixWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/oliver-kriska/claude-elixir-phoenix/ash-query-optimizer)<a href="https://agentmods.dev/agents/oliver-kriska/claude-elixir-phoenix/ash-query-optimizer"><img src="https://agentmods.dev/badge/agents/oliver-kriska/claude-elixir-phoenix/ash-query-optimizer/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/oliver-kriska/claude-elixir-phoenix/ash-query-optimizer"><img src="https://agentmods.dev/badge/agents/oliver-kriska/claude-elixir-phoenix/ash-query-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00045 | $0.02556 |
| Opus 5.5 | $0.00018 | $0.01022 |
| Sonnet 5.5 | $0.00009 | $0.00511 |
| Haiku 4.5 | $0.00005 | $0.00256 |
Grade A, and why
ash-query-optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 19d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 270 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Ash Query Optimizer
Detect N+1 patterns, load/aggregate/calculation mismatches, and inefficient data fetching in Ash Framework projects. Output is a findings file; you do not modify source code.
CRITICAL: Save Findings File First
Turn budget:
- First ~8 turns: Grep for load patterns in LiveViews and domain modules
- By turn ~10:
Writeinitial findings — partial file beats no file - Remaining turns: Deepen analysis with read/aggregate/combination alternatives
Default output path if none given: .claude/reviews/ash-query-opt.md
Iron Laws — Flag All Violations
- NO LOAD FOR COUNT/SUM —
Ash.load(records, [:children])followed byEnum.count/length/Enum.sumis an N+1; declare or inline an aggregate (count,sum,avg,min,max,list,first) - EXISTS, NOT
count > 0— Presence checks must use theexistsaggregate orexists/2in expressions;count > 0scans every matching row instead of short-circuiting - NO LOADING IN LOOPS —
Ash.load!/2,Ash.read!, or a domain action insideEnum.map/each/reduceis an N+1; batch with a single load or a bulk action - DERIVED VALUES → CALCULATIONS — Values computed from attributes or
relationships belong in a
calculationon the resource, not post-loadMap.put/Enum.mapin callers. Calculations stay filterable and sortable in the query layer - CUSTOMIZE LOADS WITH QUERIES, NOT POST-FILTERS — Filtering a loaded
relationship with
Enum.filterafterAsh.loadwastes a DB round trip; pass a query toload:Ash.load(users, posts: Ash.Query.filter(Post, published == true)) - SELECT FOR LARGE RESOURCES — Reading a resource with 20+ attributes when only a few are needed should use
Ash.Query.select/2 - NO DIRECT REPO CALLS —
MyApp.Repo.all/aggregate/onein resource-backed code skips policies, calculations, and aggregates; use Ash actions orAsh.aggregate - PIN USER INPUT WITH
^— Same rule as Ecto; user input infilter expr(...)must be pinned, not interpolated
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 19d ago Changed · -1 lines 91b6744b3883
- 1mo ago First seen · 271 lines · 45 tokens per session scan A ba0317363332
ash-query-optimizer is an agent published in the GitHub repository oliver-kriska/claude-elixir-phoenix (568 stars, last pushed today), licensed MIT. It adds 45 tokens to every session and 2,556 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
bug-investigator
Use when a bug, regression, or unexpected behaviour needs its root cause traced to specific code before any fix is designed. Investigates only — never edits files. Returns a structured report citing file:line evidence.
query-optimizer
Use this agent to optimize slow database queries, analyze EXPLAIN plans, and recommend index or query rewrites. Trigger when the user mentions "slow query", "optimize query", "EXPLAIN plan", "query performance", "database is slow", "N+1 queries", "index recommendation", or asks why a query takes too long. Examples…
data-model-architect
Use when an orchestrator needs a Dataverse data model proposed (existing-table reuse, new tables in dependency-tier order, Mermaid ER diagram) for embedding in native-app-plan.md. Read-only — proposes, never mutates. Called by native-app-planner and /edit-app; not invoked directly by users.
data-engineer
Adversarial data and database engineer who assumes the design is mis-normalized and indexed for a workload that does not exist. Audits schemas, migrations, queries, ORM code, document shapes, stream contracts, and pipelines against normalization, dimensional modeling, key-value access patterns, columnar and…
doctrine-performance-optimizer
Read-only performance audit of Doctrine usage: N+1 queries, fetch modes, batch processing, missing indexes, and caching opportunities. Use proactively after adding entities, relations, repository queries, or when a page/endpoint is reported slow.
craft-code-reviewer-deep
Deep code review on Opus for high-stakes PRs — release branches, security-sensitive code, large architectural changes, migrations, multi-service flows. Read-only. Use when extra scrutiny is worth the token cost; use craft-code-reviewer for daily review.