analyze-usage

analyze-usage is a command for Claude Code from wangke19/gemini-ai-helpers. It costs 9 tokens per session (1,828 once invoked), scanned A, a copy of analyze-usage, Apache-2.0.

A command that examines how a Google BigQuery project is being used. BigQuery is Google Cloud’s service for running SQL queries over large datasets, with costs based partly on data processed.

In plain words
What is it for?
Use it to review usage over a chosen period, find costly or frequent queries, compare users or service accounts, and produce optimization recommendations or a report.
Why use it?
It helps identify what is driving query volume and spending, which users run the most work, and which queries may need improvement.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: names the AskUserQuestion tool; positional $N argument.

Good fit Use it to review usage over a chosen period, find costly or…

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/wangke19/gemini-ai-helpers/analyze-usage
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.

Clone the repo
git clone --depth 1 https://github.com/wangke19/gemini-ai-helpers

Made for: Claude Code.

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 analyze-usage

README.md
[![agentmods](https://agentmods.dev/badge/commands/wangke19/gemini-ai-helpers/analyze-usage.svg)](https://agentmods.dev/commands/wangke19/gemini-ai-helpers/analyze-usage)
Your own site
<a href="https://agentmods.dev/commands/wangke19/gemini-ai-helpers/analyze-usage"><img src="https://agentmods.dev/badge/commands/wangke19/gemini-ai-helpers/analyze-usage.svg" alt="Measured on agentmods" height="20"></a>
Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,828 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 95% copy Near-identical to another mod 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.00009 $0.01828
Opus 5 $0.00005 $0.00914
Sonnet 5 $0.00002 $0.00366
Haiku 4.5 $0.00001 $0.00183

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

Security

Grade A, and why

analyze-usage 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 6d 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.

Origin

This is a copy

95% identical to analyze-usage — 8 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

extensions/bigquery/commands/analyze-usage.md · 219 lines

How it starts

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

Name

bigquery:analyze-usage

Synopsis

/bigquery:analyze-usage <project-id> <timeframe>
/bigquery:analyze-usage openshift-ci-data-analysis "24 hours"
/bigquery:analyze-usage my-project "7 days"

Description

The analyze-usage command provides comprehensive analysis of BigQuery usage patterns, costs, and query performance for a given project. It identifies expensive queries, heavy users, and provides actionable optimization recommendations.

This command helps answer questions like:

  • Which users or service accounts are consuming the most data?
  • What are the most expensive queries?
  • Which query patterns are running most frequently?
  • How can we reduce BigQuery costs?
  • Are we over any usage thresholds?

The analysis includes:

  • Total usage summary (queries, data scanned, estimated costs)
  • Usage breakdown by user/service account
  • Per-user deep dive analysis for top 2-3 users
  • Top individual queries by cost
  • Query pattern analysis to identify optimization opportunities
  • Specific, actionable optimization recommendations
  • Optional markdown report generation

Implementation

This command uses the bigquery:analyze-usage skill to perform the analysis.

Prerequisites

  • Google Cloud SDK (bq command-line tool) must be installed
  • User must have BigQuery read access to the project
  • User must be authenticated (gcloud auth login)

Steps

  1. Parse and Validate Arguments:

    • If project-id is missing: Use AskUserQuestion to prompt for it
    • If timeframe is missing: Use AskUserQuestion to prompt for it (options: "1 hour", "6 hours", "24 hours", "7 days", "30 days")
    • Parse timeframe into hours (e.g., "24 hours" → 24, "7 days" → 168)
  2. Invoke the analyze-usage Skill:

    Use the Skill tool to invoke "bigquery:analyze-usage"
    

    The skill will handle all the data collection and analysis.

  3. Present Results: The skill returns a comprehensive report. Present it to the user in a clear, readable format with:

    • Executive summary at the top
    • Tables for user usage and top queries
    • Per-user deep dive for top 2-3 users showing their specific query patterns
    • Detailed query pattern analysis
    • Prioritized optimization recommendations

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

Subscribe to this mod's changes

analyze-usage is a command published in the GitHub repository wangke19/gemini-ai-helpers (2 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 9 tokens to every session and 1,828 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. It is 95% identical to analyze-usage, differing in 8 lines, and is treated as a copy.