malloy-debug

malloy-debug is a skill for Claude Code, Codex from malloydata/publisher. It costs 52 tokens per session (1,507 once invoked), scanned A, original, MIT.

A troubleshooting guide for Malloy compile errors. Malloy is a language for describing data queries and models, and compiling checks whether its files are valid.

In plain words
What is it for?
Use it to investigate unknown fields, type errors, syntax problems, imports, and other errors in .malloy files.
Why use it?
It helps separate the first real problem from later errors that are often caused by it. The recommended process is to fix one earliest error, then check the diagnostics again.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/malloydata/publisher/malloy-debug
Any agent
npx skills add malloydata/publisher --skill malloy-debug
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-debug

README.md
[![agentmods](https://agentmods.dev/badge/skills/malloydata/publisher/malloy-debug.svg)](https://agentmods.dev/skills/malloydata/publisher/malloy-debug)
Your own site
<a href="https://agentmods.dev/skills/malloydata/publisher/malloy-debug"><img src="https://agentmods.dev/badge/skills/malloydata/publisher/malloy-debug.svg" alt="Measured on agentmods" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,507 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00052 $0.01507
Opus 5 $0.00026 $0.00754
Sonnet 5 $0.00010 $0.00301
Haiku 4.5 $0.00005 $0.00151

Measured today against content hash 29c8f1c91488, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

malloy-debug 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 today.

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-debug/SKILL.md · 129 lines

How it starts

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

Debugging Malloy Errors

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.

Get Diagnostics

Hosts expose errors differently, so take the best path you actually have:

  1. An editor-diagnostics tool, if your host offers one - call it on the file and read the errors straight out.
  2. Otherwise, compile by running. Run any query against the source with your query tool and read the error it returns. Every host that can run Malloy can do this, including chat surfaces with no editor.

Only ask the user to open the file in an editor when you know they have the model open in one. On a hosted chat surface there is no local checkout to open, and the query path above is the one that works.

Strategy

Errors cascade. Later errors may be caused by or hidden behind earlier ones. Fix the FIRST error only, re-check diagnostics, repeat. Do not attempt to fix multiple errors at once.

  1. Look at FIRST error, ignore all others
  2. Call search_malloy_docs with the error message if unsure
  3. Fix that one issue, re-check diagnostics
  4. Repeat until clean. New errors may appear as earlier ones are resolved

Quick Fixes

Error Fix
"Unknown field" Check typo, source order, wrong source, or missing import
"Can't use type string" Cast: field::number
"Aggregate not allowed in where" Use having: instead
20+ random errors Backtick reserved word (`Date`, `Hour`, `number`)
Can't find field 'X' to set access modifier An include {} sits before the extend { rename: }. Rename first, then include {} naming the field by its new name (see skill:malloy-gotchas-modeling § Field Management)
IO Error: No files found that match the pattern "data/x.csv" Data-file path, not the model. Relative duckdb.table() paths resolve against the DuckDB workingDirectory; Publisher sets it to the package root, but a relative workingDirectory in malloy-config.json resolves against the process cwd. Make it absolute (see skill:malloy-gotchas-modeling § Relative Data-File Paths). The "not defined" errors under it are cascade, not real
Import path errors Check paths: import "orders.malloy". All files should be in the same directory (flat layout)
unexpected 'from' from() was removed from the language. Use the query directly: source: x is q extend {...}, or source: x is (q -> {...}) extend {...}
Query-based source errors Verify the source query returns the expected columns, check that imported sources are defined
"Cannot redefine 'X'" Field already exists from query-based source (-> { group_by, aggregate }). Remove the dimension, add only NEW derived fields in extend {}. Use include {} to add #(doc) tags to existing fields.

Read the full file on GitHub · 129 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. today Changed · +1 lines 29c8f1c91488
  2. 4d ago First seen · 128 lines · 52 tokens per session scan A 7a721125d6f6

Subscribe to this mod's changes

malloy-debug is a skill published in the GitHub repository malloydata/publisher (99 stars, last pushed today), licensed MIT. It adds 52 tokens to every session and 1,507 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

frontend-style-guide

Apply the Lightdash frontend style guide and design principles when working on React components or styling frontend code. Use when editing TSX files, building or reviewing UI, fixing styling issues, or when the user mentions Mantine, design, styling, or CSS modules.

lightdash/lightdash · 56 tokens

reusable-visualization

Build ONE reusable chart visualization component that receives its data and its settings from the host application instead of fetching them, and declares the fields and config options the host exposes to viewers. Use this whenever a single chart component is reused across many different queries rather than built for…

lightdash/lightdash · 102 tokens

debug-local

Debug the Lightdash app using PM2 logs, Maple traces, and browser automation. Use when investigating issues, tracking down bugs, understanding request flow, or correlating frontend actions with backend behavior.

lightdash/lightdash · 42 tokens

lightdash-agent-slack-messaging

Use this skill when writing, designing, or generating Slack messages for Lightdash's in-app analytics agent. Triggers when someone asks to create agent update messages, Slack digests, agent notifications, weekly summaries, daily summaries, or any Slack copy for the Lightdash project agent. Also use when asked to vary…

lightdash/lightdash · 114 tokens

upgrade-preflight

Checks whether a self-hosted Lightdash upgrade is safe to run, and reads the tooling's answer without over-reading it. Use when upgrading a self-hosted instance, planning a maintenance window, answering "is this upgrade safe", or recovering a failed, hung, parked or lock-stuck migration — covers lightdash…

lightdash/lightdash · 101 tokens

breakup-pr

Break up a large PR into vertical feature slices delivered incrementally via Graphite stacked PRs. All verticals share a single feature flag so the entire feature ships atomically. Use when: splitting a large PR, breaking up a diff, vertical slicing, incremental delivery, phased rollout, or when a PR is too large to…

lightdash/lightdash · 72 tokens