data-cost-optimization

data-cost-optimization is a skill for Claude Code, Codex from j4flmao/agent-skills. It costs 138 tokens per session (4,846 once invoked), scanned A, original, MIT.

A guide to reducing costs across cloud data warehouses and storage services such as Snowflake, BigQuery, and Amazon S3. It covers query usage, compute capacity, storage tiers, budgets, and cost ownership.

In plain words
What is it for?
It is for analyzing query and credit usage, tuning warehouse settings, managing BigQuery capacity, setting S3 storage lifecycles, and creating cost-allocation or budget-monitoring plans.
Why use it?
It helps identify which queries, warehouses, and stored data are driving the bill. It also provides ways to control spending while retaining data for operational or compliance needs.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument; mentions Codex.

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/j4flmao/agent-skills/data-cost-optimization
Any agent
npx skills add j4flmao/agent-skills --skill data-cost-optimization
Clone the repo
git clone --depth 1 https://github.com/j4flmao/agent-skills

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 data-cost-optimization

README.md
[![agentmods](https://agentmods.dev/badge/skills/j4flmao/agent-skills/data-cost-optimization.svg)](https://agentmods.dev/skills/j4flmao/agent-skills/data-cost-optimization)
Your own site
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/data-cost-optimization"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/data-cost-optimization.svg" alt="Measured on agentmods" height="20"></a>
Per session 138 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,846 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.1 $0.00138 $0.04846
Opus 5 $0.00069 $0.02423
Sonnet 5 $0.00028 $0.00969
Haiku 4.5 $0.00014 $0.00485

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

Security

Grade A, and why

data-cost-optimization 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.

skills/data/data-cost-optimization/SKILL.md · 600 lines

How it starts

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

Data Cost Optimization

Purpose

Analyze, optimize, and manage cloud data platform costs across Snowflake, BigQuery, and S3, implementing FinOps practices for cost allocation, budgeting, and continuous optimization.

Agent Protocol

Trigger

Exact user phrases: "cost optimization", "cost reduction", "Snowflake cost", "BigQuery cost", "S3 cost", "warehouse cost", "FinOps data", "query cost analysis", "storage tiering", "slot management", "credit usage", "data platform cost", "cloud data cost".

Input Context

Before activating, verify:

  • Cloud data platform (Snowflake, BigQuery, Redshift, Databricks)
  • Storage systems (S3, GCS, Azure Blob)
  • Current monthly spend and growth trend
  • Query patterns (ad-hoc, scheduled, BI)
  • Data retention requirements (compliance, archival)
  • Team structure for cost allocation

Output Artifact

Cost optimization plan with warehouse configuration, query tuning, storage lifecycle policies, and FinOps dashboards.

Response Format

-- Snowflake cost analysis queries
-- Warehouse configuration
# BigQuery reservation config
# S3 lifecycle policies
# Cost allocation script
# Budget monitoring

No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.

Completion Criteria

  • Current spend analyzed by warehouse, query, user, and dataset
  • Warehouse auto-scaling and multi-cluster configuration optimized
  • Query performance tuned to reduce compute consumption
  • Storage lifecycle policies implemented for tiered archival
  • Cost allocation tags applied and budgets configured
  • Monitoring dashboards with cost-per-team breakdown
  • Optimization recommendations documented with expected savings

Max Response Length

300 lines of code and configuration.

Snowflake Cost Management

Warehouse Configuration

-- Optimal warehouse config for production workloads
CREATE WAREHOUSE prod_wh
  WAREHOUSE_SIZE = 'MEDIUM'
  AUTO_SUSPEND = 60           -- suspend after 1 minute idle
  AUTO_RESUME = TRUE
  MIN_CLUSTER_COUNT = 1
  MAX_CLUSTER_COUNT = 3
  SCALING_POLICY = 'ECONOMY'  -- prioritize cost over performance
  STATEMENT_QUEUED_TIMEOUT_IN_SECONDS = 30
  STATEMENT_TIMEOUT_IN_SECONDS = 3600;

-- For ad-hoc/exploratory workloads
CREATE WAREHOUSE analytics_wh
  WAREHOUSE_SIZE = 'XSMALL'
  AUTO_SUSPEND = 300
  AUTO_RESUME = TRUE
  MIN_CLUSTER_COUNT = 1
  MAX_CLUSTER_COUNT = 1;

Read the full file on GitHub · 600 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 600 lines · 138 tokens per session scan A 9d7d40fb9e79

Subscribe to this mod's changes

data-cost-optimization is a skill published in the GitHub repository j4flmao/agent-skills (20 stars, last pushed today), licensed MIT. It adds 138 tokens to every session and 4,846 once invoked, about $0.0007 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-09-03.