bigquery-cost-audit

bigquery-cost-audit is a skill for Claude Code from yeaight7/agent-powerups. It costs 42 tokens per session (934 once invoked), scanned A, original, Apache-2.0.

A guide for reviewing BigQuery costs, failed queries, inefficient scans, and data-workflow governance. BigQuery is Google's service for storing and querying large datasets.

In plain words
What is it for?
Use it to find expensive or failing queries, full-table scans, duplicated scheduled work, and other cost drivers, then prepare practical optimization recommendations.
Why use it?
It helps identify which jobs, users, projects, or repeated patterns are driving spend and wasting computing resources.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the data-engineering plugin — 1 skill, 4 commands, 3 agents shipped together

Good fit Use it to find expensive or failing queries, full-table scans, duplicated scheduled work, and other cost drivers, then prepare practical optimization recommendations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yeaight7/agent-powerups/bigquery-cost-audit
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 yeaight7/agent-powerups --skill bigquery-cost-audit
Clone the repo
git clone --depth 1 https://github.com/yeaight7/agent-powerups

Made for: Claude Code.

Or install data-engineering, the plugin that ships this one along with the rest of its 1 skill, 4 commands, 3 agents.

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 bigquery-cost-audit

README.md
[![agentmods](https://agentmods.dev/badge/skills/yeaight7/agent-powerups/bigquery-cost-audit/github.svg)](https://agentmods.dev/skills/yeaight7/agent-powerups/bigquery-cost-audit)
Your own site
<a href="https://agentmods.dev/skills/yeaight7/agent-powerups/bigquery-cost-audit"><img src="https://agentmods.dev/badge/skills/yeaight7/agent-powerups/bigquery-cost-audit/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 bigquery-cost-audit

Your own site · 80×15
<a href="https://agentmods.dev/skills/yeaight7/agent-powerups/bigquery-cost-audit"><img src="https://agentmods.dev/badge/skills/yeaight7/agent-powerups/bigquery-cost-audit.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 934 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.00934
Opus 5 $0.00021 $0.00467
Sonnet 5 $0.00008 $0.00187
Haiku 4.5 $0.00004 $0.00093

Measured 9d ago against content hash fa001115a973, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

bigquery-cost-audit 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 9d 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.

plugins/data-engineering/skills/bigquery-cost-audit/SKILL.md · 104 lines

How it starts

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

BigQuery Cost Audit

When to Use

  • Reviewing BigQuery query costs, failure patterns, or performance inefficiencies.
  • Identifying which jobs, users, or projects are driving the highest spend.
  • Preparing optimization recommendations for an engineering or cost-review meeting.
  • Auditing governance: scheduled jobs, duplicated logic, or low-value recurring queries.

Goals

  • Identify the main cost drivers by job, project, and user.
  • Detect repeated waste patterns (full scans, failed retries, duplicated logic).
  • Suggest realistic optimizations with estimated impact.
  • Translate technical waste into business-language findings.

What to Inspect

Cost hotspots

-- Top 20 most expensive jobs in the past 7 days
SELECT
  job_id, user_email, query,
  total_bytes_processed / POW(1024, 4) AS tb_processed,
  ROUND(total_bytes_processed / POW(1024, 4) * 6.25, 2) AS estimated_cost_usd,
  creation_time
FROM `region-us`.INFORMATION_SCHEMA.JOBS
WHERE creation_time > TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
  AND job_type = 'QUERY'
  AND state = 'DONE'
ORDER BY total_bytes_processed DESC
LIMIT 20;

Repeated failures

SELECT
  error_result.reason, COUNT(*) AS failure_count, user_email,
  ANY_VALUE(query) AS sample_query
FROM `region-us`.INFORMATION_SCHEMA.JOBS
WHERE creation_time > TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
  AND error_result IS NOT NULL
GROUP BY error_result.reason, user_email
ORDER BY failure_count DESC;

Missing partition pruning

Look for queries that scan full tables despite available partition columns:

  • No WHERE filter on the partition column.
  • _PARTITIONTIME or _PARTITIONDATE not in the filter.
  • LIMIT used without a partition filter (does not reduce scan cost).

Missing clustering

Check high-scan queries that filter on non-clustered columns after partitioning is already in place.

Scheduled jobs with low value

-- Find scheduled queries with high scan volume (via Data Transfer Service run history)
-- Note: scheduled query metadata lives in region-specific transfer_run tables.
-- Substitute your project and region:
SELECT
  config.display_name,
  run.state,
  run.end_time,
  run.error_status
FROM `<project>.<region>.INFORMATION_SCHEMA.SCHEDULED_QUERY_RUNS` AS run
JOIN `<project>.<region>.INFORMATION_SCHEMA.SCHEDULED_QUERIES` AS config
  ON run.scheduled_query_id = config.scheduled_query_id
WHERE run.end_time > TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
ORDER BY config.display_name, run.end_time DESC;
-- Then cross-reference with JOBS to find per-run bytes_processed.

Read the full file on GitHub · 104 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. 9d ago First seen · 104 lines · 42 tokens per session scan A fa001115a973

Subscribe to this mod's changes

bigquery-cost-audit is a skill published in the GitHub repository yeaight7/agent-powerups (6 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 42 tokens to every session and 934 once invoked, about $0.0002 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-31.