flux-query

flux-query is a skill for Claude Code from tonone-ai/tonone. It costs 42 tokens per session (791 once invoked), scanned A, original, MIT.

A database query optimisation helper that examines SQL or database-library queries and their execution plans, which show how a database runs them. It can suggest indexes or query rewrites based on the query's work.

In plain words
What is it for?
Use it to investigate slow queries, review EXPLAIN output, identify missing indexes, and rewrite SQL or ORM queries.
Why use it?
It helps find why a query is slow, such as reading an entire table or lacking an index. This avoids guessing when improving database performance.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the TodoWrite tool; mentions Claude Code.

Part of the engineering-team plugin — 80 skills shipped together

Good fit Use it to investigate slow queries, review EXPLAIN output, identify missing indexes, and rewrite SQL or ORM queries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tonone-ai/tonone/flux-query
Install

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.

Any agent
npx skills add tonone-ai/tonone --skill flux-query
Clone the repo
git clone --depth 1 https://github.com/tonone-ai/tonone

Made for: Claude Code.

Or install engineering-team, the plugin that ships this one along with the rest of its 80 skills.

Wrote 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.

agentmods badge for flux-query

README.md
[![agentmods](https://agentmods.dev/badge/skills/tonone-ai/tonone/flux-query/github.svg)](https://agentmods.dev/skills/tonone-ai/tonone/flux-query)
Your own site
<a href="https://agentmods.dev/skills/tonone-ai/tonone/flux-query"><img src="https://agentmods.dev/badge/skills/tonone-ai/tonone/flux-query/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.

agentmods 80×15 button for flux-query

Your own site · 80×15
<a href="https://agentmods.dev/skills/tonone-ai/tonone/flux-query"><img src="https://agentmods.dev/badge/skills/tonone-ai/tonone/flux-query.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 791 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.00791
Opus 5.5 $0.00017 $0.00316
Sonnet 5.5 $0.00008 $0.00158
Haiku 4.5 $0.00004 $0.00079

Measured 17d ago against content hash 28a327bb6f57, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

flux-query 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 17d 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.

bundle/engineering-team/skills/flux-query/SKILL.md · 90 lines

How it starts

The opening of the file, as written. The whole thing — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Optimize Slow Queries

You are Flux — the data engineer on the Engineering Team.

Follow the output format defined in docs/output-kit.md — 40-line CLI max, box-drawing skeleton, unified severity indicators, compressed prose.

Steps

Step 0: Detect Environment

Identify the database:

  • Check for ORM configs: prisma/schema.prisma, alembic.ini, drizzle.config.ts, ormconfig.ts
  • Check for connection strings to identify the engine (PostgreSQL, MySQL, SQLite, etc.)
  • Check for query code: ORM queries, raw SQL files, repository/DAO layers
  • Identify if there is a query logging or APM tool in use

If the stack is ambiguous, ask the user.

Step 1: Read the Query

Get the full query — either from the user directly or by finding it in the codebase:

  • Search for the slow query in ORM code, raw SQL, or query builder calls
  • If the user provides EXPLAIN output, read it carefully
  • Understand the intent: what data is this query trying to retrieve?

Step 2: Analyze the Query

Check for these common performance problems:

  • Missing indexes — columns in WHERE, JOIN ON, ORDER BY without indexes
  • Full table scans — no filtering or filtering on unindexed columns
  • SELECT * — pulling columns that aren't needed
  • Missing LIMIT — unbounded result sets
  • Unnecessary JOINs — joining tables whose data isn't used in output
  • Correlated subqueries — subqueries that execute per-row instead of once
  • Subquery vs JOIN — subqueries in WHERE that could be JOINs
  • N+1 patterns — ORM code that triggers a query per row
  • Implicit type casting — comparing mismatched types that prevent index use
  • Functions on indexed columns — WHERE LOWER(email) = ... can't use an index on email

Step 3: Suggest Fixes

For each issue found:

  1. Suggest specific indexes — with exact CREATE INDEX statements
  2. Rewrite the query if the structure is the problem
  3. Add LIMIT/pagination if results are unbounded
  4. Replace SELECT * with specific columns
  5. Convert subqueries to JOINs where beneficial

Read the full file on GitHub · 90 lines

Changes

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.

  1. 17d ago First seen · 90 lines · 42 tokens per session scan A 28a327bb6f57

Subscribe to this mod's changes

flux-query is a skill published in the GitHub repository tonone-ai/tonone (76 stars, last pushed 9d ago), licensed MIT. It adds 42 tokens to every session and 791 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-09-27.

Related

Other skills, from other repositories