B JA ZOZO·Practitioner post·

Monthly cloud budget-vs-actual with a Claude Code skill: amounts by query, causes by AI, decisions by people (Claude Codeのスキルで回すGoogle Cloudコストの月次予実管理)

B · Useful, limited Tajima of ZOZO's messaging-platform team documents a Claude Code skill for monthly cloud budget-vs-actual work with a clear split between query-computed amounts, AI-proposed causes and human decisions, and a worked failure case; the outcome figures are self-reported and approximate.

Summary based on the full text·Original: about 18 minutes to read

In short

A ZOZO Tech Blog post (4 November 2026) by Tajima of the team running ZOZOTOWN's push, LINE and email delivery platform on Google Cloud. Monthly budget-vs-actual review across four environments used to take several days. A Claude Code skill now runs it: amounts are computed by queries and scripts, the agent proposes causes for variances from delivery volumes and GitHub PRs and issues, and people check and decide. All numbers and reasons live in a Google Sheet; the skill holds only procedure.

Key numbers

  • several days to 1-2 hoursmonthly budget-vs-actual work before vs after the skill
  • over 10% to a few percentgap between estimate and actual across all environments, early operation vs recent months
  • 4 environments, tens to about 100 SKUs eachscope of the Google Cloud cost review (PRD, QA, STG, DEV)
  • about $272 vs about $711June estimate vs actual for Memorystore for Valkey, which started billing mid-month; the miss led to a new rule in the skill

As reported by the source.

Read the original on techblog.zozo.com

Japanese·Web page·opens techblog.zozo.com

What it reports

  • Data flow: BigQuery billing export into Google Sheets via Connected Sheets; the skill is a SKILL.md with procedures and decision criteria plus Python scripts calling the Sheets API.
  • Design rule: the AI never produces amounts. Actuals come from queries and sheet formulas, estimates from scripts, report figures copied by script. The AI explains variances and adjusts estimates from query-derived values, writing its basis in a comment column for a human to check.
  • The agent maps delivery volume to services (Cloud Run, Pub/Sub, Firestore, BigQuery) to see whether a variance is explained by volume, and digs into releases or configuration changes only for the rest.
  • Labels break down costs inside a single SKU, though many resources are not yet labelled.
  • Delegation grew stepwise: at first a person and the agent investigated each variance together, and errors were written back into SKILL.md. After a few months the agent writes all comments first and people review only what looks wrong. One task (scanning PRs for upcoming cost changes) was moved back to people.
  • Failure case: Memorystore for Valkey began billing on 20 May 2026, so May had 12 days of data. June's estimate scaled from that was about $272; the actual was about $711 (about $23.7 a day for 30 days). A rule to adjust mid-month starts to the full monthly amount was added.
  • Billing-data pitfalls recorded in the skill: filter by _PARTITIONTIME to avoid full scans, negative rows in cost_at_list, JST for daily trends but UTC for monthly totals, SKU names that differ from plan names or carry trailing spaces.
  • Results: monthly work from several days to 1-2 hours; estimate error from over 10% in some early months to a few percent recently; finer cost tracking enabled savings.

How they got it

A first-person engineering account with design rationale, the sheet layout and example reports. Results are the team's own observations; the setup first ran on Codex before moving to Claude Code.

Limits

  • Outcome figures are approximate and self-reported; no savings amount is given.
  • Investigation deep-dives, checks for missing change notes and estimate review are still manual; volume growth and system changes are not detected automatically.
  • The gcloud token used grants access to all of Google Drive; the author suggests a service account scoped to the sheet if that is a concern.

Why it matters for companies

This is a reusable pattern for finance-adjacent agent work: keep numbers deterministic, let the agent explain, keep decisions with people, and store history in a shared sheet that non-engineers can read. Writing each miss back into the procedure is how the error rate came down; the agent follows written steps reliably and misses what is not written. The broad Drive token is a common shortcut that security teams should catch before such skills spread.

Key passages in translation

Japanese original

コストの数字は予算に関わるため、ずれがあってはいけません。そのため、金額の取得と集計はAIに任せず、すべてクエリとスクリプトで機械的に行っています。

English translation

Cost figures feed the budget, so they cannot be off. That is why fetching and totalling amounts is not left to AI; it is all done mechanically with queries and scripts.

Japanese original

AIは手順に書いてあることを確実に実行します。一方で、書いていないことには気付けない場合があります。

English translation

The AI reliably carries out what is written in the procedure. On the other hand, it may not notice what is not written.

Japanese original

以前は、月次の予実管理に毎月数日かかっていました。今は、同じ作業が1〜2時間で終わります。

English translation

Monthly budget-vs-actual work used to take several days each month. Now the same work is done in one to two hours.

Summary based on the full text. Read the original for the full argument and data.Read the original on techblog.zozo.com

Tags

Same week

All of Week 45