malloy-queries

malloy-queries is a skill for Claude Code, Codex from malloydata/publisher. It costs 42 tokens per session (5,756 once invoked), scanned A, original, MIT.

A reference for writing and debugging Malloy queries, a way to ask structured questions of modeled data.

In plain words
What is it for?
It helps build grouped summaries, time trends, filtered queries, percentages, and refined views using the available data model.
Why use it?
It reduces errors from guessing field names, joins, filters, date expressions, or aggregation syntax.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps build grouped summaries, time trends, filtered queries, percentages, and refined views using the available data model.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/malloydata/publisher/malloy-queries
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 malloydata/publisher --skill malloy-queries
Clone the repo
git clone --depth 1 https://github.com/malloydata/publisher

Made for: Claude Code, Codex.

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 malloy-queries

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/malloydata/publisher/malloy-queries"><img src="https://agentmods.dev/badge/skills/malloydata/publisher/malloy-queries.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 5,756 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.05756
Opus 5.5 $0.00017 $0.02302
Sonnet 5.5 $0.00008 $0.01151
Haiku 4.5 $0.00004 $0.00576

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

Security

Grade A, and why

malloy-queries 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.

skills/malloy-queries/SKILL.md · 368 lines

How it starts

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

Malloy Query Reference

Only use field names defined in the model. Ground yourself first with get_context; never invent entities or guess field names.

Tool names are written bare here - get_context, execute_query, search_malloy_docs. The exact prefixed name depends on the host surface; match each against the tools you actually have.

Query Patterns

Simple aggregation:

run: source -> {
  aggregate: total_revenue, order_count
}

Group by dimension:

run: source -> {
  group_by: category
  aggregate: revenue
  order_by: revenue desc
  limit: 10
}

Time trend:

# line_chart
run: source -> {
  group_by: order_date.month
  aggregate: revenue
  order_by: 1
}

Filtered query:

run: source -> {
  where: status = 'active'
  group_by: region
  aggregate: count_orders, total_revenue
}

Run a pre-built view:

run: source -> view_name

Refine a view with additional options:

run: source -> view_name + { limit: 10, where: region = 'US' }

Percent of total: use all(), not parent().

run: source -> {
  group_by: category
  aggregate:
    revenue
    pct_of_total is revenue / all(revenue)
}

Conditional dimensions with pick: pick is a keyword, not a function.

run: source -> {
  group_by:
    tier is pick 'Premium' when price > 100
            pick 'Standard' when price > 50
            else 'Budget'
  aggregate: count()
}

Wrong: pick('Premium') { ... } (that's not Malloy syntax).

Window functions with calculate:: running totals, lag(), lead(), and other window operations belong in calculate:, not aggregate:.

run: source -> {
  group_by: order_month is order_date.month
  aggregate: revenue
  calculate: prev_month_revenue is lag(revenue)
  order_by: order_month
}

Field Paths and Joins

Use the joins the model declares. When you answer a question over a published model, every query is rooted on one source, and you reach a joined source's fields by a dotted path within the query body (for example stores.region). Do not write join_one or join_many in an answer query, and never invent a join key. (A join written in a query does compile, and model files and notebooks use them; the rule is that an answer uses the joins the model declares.) If the field you need is on a source the model does not join, say so and ask the user to add the join to the model. If you do write a join in query text, it is gated as if you had entered that source yourself: a locked source refuses the query with a 403 that names your alias, and a row-filtered source filters the rows your join sees, so a denial on a join you wrote means the joined source refused you, not that the model is broken.

Read the full file on GitHub · 368 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. 19d ago Changed · +22 lines 0a951e1804bd
  2. 1mo ago Changed 7c78f9537295
  3. 1mo ago Changed · +46 lines · -2 tokens per session d6e75982e928
  4. 2mo ago Changed · +22 lines 8e42a55fc552
  5. 2mo ago Changed · +4 lines 88eb7116132e
  6. 2mo ago Changed · -1 lines 4191763ade7f
  7. 2mo ago Changed · -2 tokens per session 9af8bcc515c8
  8. 3mo ago First seen · 275 lines · 46 tokens per session scan A 564829bc9265

Subscribe to this mod's changes

malloy-queries is a skill published in the GitHub repository malloydata/publisher (136 stars, last pushed today), licensed MIT. It adds 42 tokens to every session and 5,756 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.

Related

malloy-queries compared with skills from other repositories

malloy-queries next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
malloy-queriesmalloydata/publisherSkill136todayMITA42Claude Code, Codex
yodalightdash/lightdashSkill6.3ktodaynoneA64Claude Code, Codex
developing-with-streamlitstreamlit/streamlitSkill47kyesterdayApache-2.0A146Claude Code
tao-analyze-gaps-visual-changenetNVIDIA/skillsSkill4.2k2d agoApache-2.0A103Claude Code
tao-analyze-gaps-od-mapNVIDIA/skillsSkill4.2k2d agoApache-2.0A84Claude Code
cnsplotsfaridrashidi/cnsplotsSkill7376d agoBSD-3-ClauseA79Codex
reimagine-it-extractKayforkind/reimagine-itSkill2182d agoMITA133Claude Code