billflare.

A prompt to set up Cloudflare budget and usage alerts

Merill Fernando (@merill) shares a prompt that asks a coding agent to install Cloudflare’s CLI, check for a billing budget alert and add usage alerts based on last month’s usage, and lists what it set up for him.

Products
WorkersDurable Objects
Source
Author experience𝕏
Author
Merill Fernando (@merill)

Key points

  • The prompt asks the agent to install Cloudflare’s CLI (npm i -g cf), log in, check for a billing budget alert, review last month’s usage, add usage alerts for Workers requests, Workers CPU and Durable Objects set well above normal, and send a test alert.
  • The author reports it set up a $10 budget alert, alerts on Workers requests (2M) and CPU (20M ms), alerts on Durable Objects requests, duration, reads and writes, and a received test email in under three minutes.
  • He writes that Cloudflare has no spending cap and alerts are all you get, and asks why usage alerts cannot be set on SQLite-backed Durable Objects, the default type that shmily7’s alarm loop hit.

Original sources

  1. Original post

    Read on 𝕏

    Merill Fernando (@merill) shares a prompt that asks a coding agent to install Cloudflare’s CLI, check for a billing budget alert and add usage alerts based on last month’s usage, and lists what it set up for him.

    Merill Fernando

    @merill · Original 𝕏 post

    Rough one. If you've got a project on Cloudflare (vibe coded or not), here's a prompt to make sure this doesn't happen to you 👇 Paste into Claude Code or any agent : "Install Cloudflare's CLI (npm i -g cf) and log me in. Check I have a billing budget alert. Look at last… https://t.co/jqdyX4vJvf
Author experienceWorkers KV +2

Feng Yi: On the free tier, the cheapest rollback is not a release—it's a switch in KV

On 2026-11-21, X user @Michael_liyang (Feng Yi) wrote: on the free tier, the cheapest rollback is not a release—it's a switch in KV. Steps: 1 put the switch in KV; 2 read the switch first on the request—on takes the new path, off takes the old path; 3 canary-split by user hash, 10% first and then full rollout; 4 if something goes wrong, change KV and roll back immediately, without waiting for a release. Path: request → read switch → split → new/old path → log to D1. Switches also need expiry cleanup; don't let them pile up into dead config.

D1

hiromsaeden: an unindexed D1 query loop billed $2,129.00; a $953.74 courtesy credit left $645.38 due.

Cloudflare Community user hiromsaeden, in a post-mortem of a personal hobby project on Workers and D1, says an unindexed GROUP BY aggregate query scanned about 877,000 rows to return 30 rows, and an unintended loop triggered about 315,000 runs across two billing cycles. In the Oct 15 – Nov 15 cycle alone, 1,447,580,203,670 rows (1.44 trillion rows) were read, on top of the previous cycle’s usage. The author says the October invoice IN-83890481 was $529.88 USD, paid in full out of pocket; the November invoice IN-89082487 was $1,599.12 USD ($1,447.58 D1 Rows Read + $6.16 Workers CPU + $145.38 tax); and the total billed was $2,129.00 USD against an expected budget of about $20/month. After noticing the issue on Nov 2–3, the author deleted the Worker and the D1 database; Support confirmed all reads had stopped. In case #02408621, Support offered a $275.00 courtesy credit for October and advised holding it until the November invoice was issued on Nov 15. In case #02434399, Support applied a one-time courtesy credit of $953.74 (which included the held $275.00), leaving a final balance of $645.38 USD, and said the review was complete and no further adjustments can be made. The author, having already paid $529.88, says the remaining $645.38 cannot be afforded and the account will be downgraded on Nov 22. The author also says a budget alert fired once at the $37 mark but did not stop the charges, and that D1 currently has no hard spending cap. There is no Cloudflare staff reply on the public thread; the Support actions are reported by the author.

Author experienceD1 +2

Feng Yi: a free Cloudflare stack still needs an exit map; if a restore into a fresh account takes over 30 minutes, it is cheap but not operationally free

On 2026-11-21, X user @Michael_liyang (Feng Yi) replied to @hiromu_bdy that the free stack still needs an exit map: export D1 to SQL, R2 objects with checksums, and Worker config to version control. Test a restore into a fresh account; if that takes over 30 minutes, the stack is cheap but not operationally free. The 30-minute threshold is the author’s operational test, not an official limit or a billed amount.