How this command is triggered — by the user, by Claude, or both
Slash command
/bigquery:analyze-usage <project-id> <timeframe>The summary Claude sees in its command listing — used to decide when to auto-load this command
## Name bigquery:analyze-usage ## Synopsis ## 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: - To...
bigquery:analyze-usage
/bigquery:analyze-usage <project-id> <timeframe>
/bigquery:analyze-usage openshift-ci-data-analysis "24 hours"
/bigquery:analyze-usage my-project "7 days"
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:
The analysis includes:
This command uses the bigquery:analyze-usage skill to perform the analysis.
bq command-line tool) must be installedgcloud auth login)Parse and Validate Arguments:
Invoke the analyze-usage Skill:
Use the Skill tool to invoke "bigquery:analyze-usage"
The skill will handle all the data collection and analysis.
Present Results: The skill returns a comprehensive report. Present it to the user in a clear, readable format with:
Offer to Save Report: After presenting the analysis, ask the user if they want to save it to a markdown file:
bigquery-usage-<project-id>-<timestamp>.mdImportant for Claude:
bigquery:analyze-usage skill using the Skill toolAnalyze last 24 hours for a project:
/bigquery:analyze-usage openshift-ci-data-analysis "24 hours"
Returns comprehensive report showing:
bigquery-usage-openshift-ci-data-analysis-20251202.mdAnalyze last 7 days:
/bigquery:analyze-usage my-project "7 days"
Provides weekly usage analysis with trends and patterns.
Missing arguments - prompts user:
/bigquery:analyze-usage
Claude asks:
Partial arguments:
/bigquery:analyze-usage openshift-ci-data-analysis
Claude asks: "What timeframe should I analyze?" (with options: 1 hour, 6 hours, 24 hours, 7 days, 30 days)
project-id (required): The GCP project ID to analyze
openshift-ci-data-analysistimeframe (required): Time period for analysis
The generated report includes:
Table showing top 10-20 users:
Detailed breakdown of top 5-10 query patterns:
For each top user by data scanned:
Table of top 20 queries by bytes scanned:
Prioritized list of actions:
region-us INFORMATION_SCHEMA. May need adjustment for other regions.gcloud auth loginbigquery.jobs.list permission at minimum"bq command not found"
brew install google-cloud-sdk (macOS) or visit cloud.google.com/sdk"Access Denied" errors
gcloud auth login to authenticatebq ls --project_id=<project-id>"Invalid project ID"
gcloud projects listNo data returned
region-us, US, EU, etc.)npx claudepluginhub cblecker/ai-helpers --plugin bigquery/analyze-usageAnalyzes BigQuery usage patterns and costs for a project: total usage summary, per-user breakdown, expensive queries, and optimization recommendations.