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 2mo 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.
- 2mo ago Changed · -1 lines 91b6744b3883
- 3mo 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 (580 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.
ash-query-optimizer compared with agents from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| ash-query-optimizeroliver-kriska/claude-elixir-phoenix | Agent | 580 | today | MIT | A | 45 | Claude Code |
| bug-investigatorkardebadas/claude-plugin | Agent | 3 | 18d ago | Apache-2.0 | A | 46 | Claude Code |
| query-optimizeriwritec0de/app-dev | Agent | 3 | 7mo ago | MIT | C | 122 | Claude Code |
| data-model-architectmicrosoft/power-platform-skills | Agent | 1.2k | today | MIT | A | 82 | Claude Code |
| data-engineertestdouble/han | Agent | 366 | 2d ago | MIT | A | 216 | Claude Code |
| doctrine-performance-optimizerdev-toolings/superpowers-symfony | Agent | 237 | 24d ago | MIT | A | 53 | Claude Code |
| fec-performance-optimizerbovinphang/frontend-craft | Agent | 24 | 18d ago | MIT | A | 72 | Claude Code |