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.
npx agentmods add skills/altimateai/altimate-code/query-optimizenpx skills add AltimateAI/altimate-code --skill query-optimizegit clone --depth 1 https://github.com/AltimateAI/altimate-codeWhat 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 | $0.00012 | $0.00924 |
| Opus 5 | $0.00006 | $0.00462 |
| Sonnet 5 | $0.00002 | $0.00185 |
| Haiku 4.5 | $0.00001 | $0.00092 |
Grade A, and why
query-optimize 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 2d 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 — 87 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Query Optimize
Requirements
Agent: any (read-only analysis)
Tools used: altimate_core_rewrite (with verify_equivalence: true), sql_analyze, sql_explain, read, glob, schema_inspect, warehouse_list
Analyze SQL queries for performance issues and suggest concrete optimizations including rewritten SQL.
Workflow
-
Get the SQL query -- Either:
- Read SQL from a file path provided by the user
- Accept SQL directly from the conversation
- Read from clipboard or stdin if mentioned
-
Determine the dialect -- Default to
snowflake. If the user specifies a dialect (postgres, bigquery, duckdb, etc.), use that instead. Check the project for warehouse connections usingwarehouse_listif unsure. -
Run the verified optimizer:
- If the user has a warehouse connection, first call
schema_inspecton the relevant tables to build schema context (needed both for better rewrites — e.g. SELECT * expansion — and to verify equivalence) - Call
altimate_core_rewritewith the SQL, schema context, andverify_equivalence: true. This proposes rewrites AND proves each one returns the same results as the original in a single step. The result is partitioned into verified-equivalent rewrites (safe to apply) and unverified rewrites (review before applying), so you never recommend a rewrite that silently changes semantics.
- If the user has a warehouse connection, first call
-
Run detailed analysis:
- Call
sql_analyzewith the same SQL and dialect to get the full anti-pattern breakdown with recommendations
- Call
-
Get execution plan (if warehouse connected):
- Call
sql_explainto run EXPLAIN on the query and get the execution plan - Look for: full table scans, sort operations on large datasets, inefficient join strategies, missing partition pruning
- Include key findings in the report under "Execution Plan Insights"
- Call
-
Equivalence verification is built into step 3 (
verify_equivalence: true):- Present the verified-equivalent rewrites as safe to apply.
- Present unverified rewrites separately with their reason ("review before applying") — do not recommend applying these without manual review.
- If no schema was available, all rewrites come back unverified; say so and recommend supplying a schema (or a warehouse connection) to enable verification.
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.
- 2d ago First seen · 87 lines · 12 tokens per session scan A 643cd0ec1391
query-optimize is a skill published in the GitHub repository AltimateAI/altimate-code (803 stars, last pushed 2d ago), licensed MIT. It adds 12 tokens to every session and 924 once invoked, about $0.0001 per session on Opus 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 skills, from other repositories
review-prs
Review a GitHub pull request in the googleapis/mcp-toolbox repo against the team's reviewer checklist: PR title/description conventions, linked issue, logic errors and unhandled edge cases, breaking changes, test coverage, docs updates, security (input handling), and new dependencies. Use whenever a maintainer asks…
fix-failing-tests
Diagnose a failing test in the googleapis/mcp-toolbox repo and land a fix by reasoning from the actual error: read the failure, reproduce it, shrink it until the cause is forced into the open, then fix the cause. Use this whenever a test or CI job is red, a build breaks after a change, many packages fail at once, or a…
stale-sweep
Sweep the googleapis/mcp-toolbox repo for issues and PRs with no real activity in N days (default 60), sort each by whose silence it is (the author's, ours, or nobody's), and draft the nudge or close comment. Use whenever a maintainer asks for a stale sweep, backlog cleanup, or an SLO check, e.g. "stale sweep", "find…
triage-issues
Triage GitHub issues in the googleapis/mcp-toolbox repo: propose the correct labels (type / priority / product / status), check for duplicates, verify a bug has enough info to act on, and draft a triage comment. Use whenever a maintainer asks you to triage, label, categorize, prioritize, or "look at" an issue (or a…
data-divergence
Investigate why two datasets that should agree don't — two pipelines writing the same logical table, a rollup vs the detail it aggregates, a dashboard vs its source, one environment vs another. Use when row counts, totals, or date ranges disagree and the question is what happened rather than just what differs. Covers…
sql-diagram
Diagram a SQL query and explain what it shows — either its execution steps (mode=plan) or its column lineage (mode=lineage) — then trace it through small data so the defects the picture cannot show become visible. Use when asked to visualize, diagram, explain or review what a query does, how it joins its tables, or…