On This Page8 sections
Key Takeaways
- October 9, 2026 update: Cloudflare Support stated that it had processed a $10,701.41 refund covering the Durable Objects charges incurred during the September 23–October 6 incident. The developer said the refund was awaiting arrival, not yet confirmed as settled in the account. The original invoice was $10,811.41, leaving a $110.00 difference that public records do not fully itemize.
- Developer @shmily7 publicly reported the runaway bill and thanked Cloudflare's Ashley Peacock for helping resolve the dispute after an initial Support refusal.
- The final support explanation identified a
PiSessionDOalarm handler that repeatedly scheduledsetAlarm(Date.now())after a checkpoint entered its refresh window, reaching approximately 600 invocations per second. Repeated SQLite rows read and written, rather than CPU duration alone, were the main cost driver. - The developer's investigation attributed the original scheduling defect to an OpenAI Codex session using
gpt-5.6-sol. The shared Git and session history has not been independently audited, and one later self-reported development date differs from the screenshot's date. - The developer had stopped using an experimental multi-agent Cloudflare Sandbox project, but its deployed background work could still accumulate fees with no active users.
- Public comments welcomed the refund while disagreeing about responsibility: some demanded platform-level hard caps, others criticized unreviewed AI-generated infrastructure code, and several proposed fixed-price VPS hosting.
- Cloudflare announced on October 2 that hard spending caps were in prototype, targeting early availability in Q4 2026. That announcement does not mean a general-purpose account hard cap is already available.
- Account budget alerts remain informational, not an automatic stop; safe workloads additionally need minimum alarm delays, persistent retry budgets, bounded database work, and tested kill switches.
October 9 Update: Cloudflare Processes a $10,701.41 Refund
The October 8 version of this story ended with the billing outcome unresolved. A new October 9 post from @shmily7 materially changed the result: the developer reported that Cloudflare had agreed to refund the expenses generated during the bug's active period. The author attributed the escalation and resolution to assistance from Ashley Peacock.
The developer reproduced a longer Cloudflare Support response signed by Daniel. It apologized for both the large surprise bill and slow support handling, explained the scheduling failure, and stated that a US$10,701.41 refund had been processed for Durable Objects rows read, rows written, requests, and duration between September 23 and October 6, 2026. Support said the credit or refund should appear in the account within the next few billing days.
| Case detail | Status reported on October 9, 2026 |
|---|---|
| Invoice originally displayed | US$10,811.41 |
| Refund processed by Support | US$10,701.41 |
| Numerical difference | US$110.00 |
| Affected charge period | September 23–October 6, 2026 |
| Covered services | Durable Objects rows read, rows written, requests, and duration |
| Money returned to the developer's account? | Not yet independently confirmed; author described the refund as pending arrival |
| Is this a universal refund policy? | No; the evidence documents this individual case only |
Important distinction: The support message described the refund as covering all affected Durable Objects charges, not the entire $10,811.41 invoice. The remaining $110 is simply the arithmetic difference; the publicly shared support message does not provide an audited line-item explanation for that amount.
The turnaround also changes the interpretation of Cloudflare's response. Support initially declined to waive customer-code-generated usage, then issued an apology and processed an exception after escalation. The final message acknowledged weaknesses in the support experience without claiming that Cloudflare's billing measurements were incorrect.
The author added more context: typical monthly Cloudflare usage was approximately $100–$300; they had relied on a default $10 notification rather than configuring additional thresholds. After the incident, they reported creating alerts at $100, $300, $500, $1,000, and $3,000 with multiple recipient addresses. These are the author's chosen alert levels, not a guarantee that charges stop at those amounts.
New Primary Sources
- Developer's October 9 resolution post, with full quoted Support response.
- Developer's October 8 account of paying the invoice and planning to migrate.
- Cloudflare's October 2 statement on future hard spending caps.
The primary X link may require login; the reported outcome is corroborated by publicly indexed reproductions of the author's statement. It has not been independently checked against the developer's bank transaction history.
What Happened? The $10,811 Cloudflare Billing Incident
On October 6, 2026, an independent developer operating the X account @shmily7 publicly reported receiving an unexpected Cloudflare bill of approximately $10,000.
According to the developer, the charges originated from an experimental project running Cloudflare Durable Objects. A scheduled alarm entered an uncontrolled execution loop, reportedly generating approximately six trillion reads and writes.
The project was described as an unused research application rather than a commercial service experiencing unusually high traffic. In the October 9 follow-up, the author explained that the experiment used Cloudflare Sandbox to test whether a main AI agent and multiple cooperating sub-agents could process development tasks faster. Results were inconclusive, development stopped, but the deployment remained active.
That distinction makes the incident particularly important for independent developers. A serverless application can produce substantial infrastructure charges without attracting new users, processing customer payments, or generating meaningful revenue.
The developer initially blamed AI-assisted programming and later identified OpenAI Codex as the coding agent responsible for introducing the original problematic logic.
By October 8, the developer reported having paid $10,811.41 to avoid potential disruption to Cloudflare services. In the later account, the developer said a temporary increase to the credit-card limit had been necessary to make payment. On October 9, Cloudflare Support stated that $10,701.41 in incident-related Durable Objects charges had been processed for refund; the developer still awaited the funds appearing in the account.
Original Screenshot: The $10,811.41 Cloudflare Invoice

Figure 1. Original screenshot shared in the developer's X discussion. The Cloudflare payment interface displays an outstanding balance of $10,811.41 for an October 6, 2026 invoice. The screenshot shows the payment process and should not be mistaken for an independently verified successful payment receipt.
The screenshot provides evidence of the invoice amount, while the statement that payment was completed comes from the developer's subsequent public update. The later refund announcement likewise derives from the developer's shared Support message, not an independently inspected bank statement.
Before the refund was approved, the developer announced an intention to migrate projects from Cloudflare to self-hosted VPS infrastructure and expressed dissatisfaction with the handling of the billing dispute. The October 9 statement was more appreciative of Cloudflare's ability to launch experiments quickly; whether the earlier migration plan was completely abandoned was not established in that update.
Timeline: How the Cloudflare Billing Incident Unfolded
The publicly described sequence combines development history, the beginning of abnormal usage, and the subsequent billing dispute.
| Date | Event | Significance |
|---|---|---|
| August 31, 2026 | Codex reportedly generates and commits checkpoint scheduling code | Original problematic logic introduced |
| September 3, 2026 | A subsequent Claude-assisted change modifies checkpoint reuse behavior | Potential secondary contributor |
| September 23, 2026 | Checkpoint refresh conditions reportedly trigger the faulty execution path | Beginning of abnormal Durable Objects activity |
| October 6, 2026 | Developer publicly reports an approximately $10,000 bill | Incident becomes public |
| October 6, 2026 | Cloudflare Support declines an initial billing credit request | First documented support outcome |
| October 8, 2026 | Developer reports paying $10,811.41 | Full-payment statement published |
| October 8, 2026 | Cloudflare personnel indicate that internal discussions are ongoing | Escalation in progress |
| October 9, 2026 | Developer publishes final Support reply confirming a $10,701.41 refund processed | Charges from the bug period refunded; arrival of funds still pending |
The developer's later explanation identifies the problem as a delayed execution failure rather than a loop that had necessarily been running continuously since the original code was generated. Date caveat: the coding-session screenshot identifies an August 31 session, while the October 9 narrative loosely recalls August 29. The article uses the more specific screenshot date for the investigation timeline and does not treat the two claims as independently reconciled.
This is a crucial distinction. The reportedly dangerous code existed for weeks before a particular state and expiration condition activated it.
Cloudflare Support's Response: Why the Initial Refund Was Declined and Later Reversed
One of the most important pieces of evidence is the original screenshot of a Cloudflare Support response shared by the developer.
The response identifies the invoice amount as $10,811.41 and attributes most of the charges to Durable Objects usage between September 23 and October 6, 2026.
Cloudflare Support explained that usage-based charges caused by customer application code were not considered a platform metering or infrastructure failure.
On that basis, the support response stated that the team could not issue a credit for the reported Durable Objects usage.
Original Screenshot: Cloudflare Support's Billing Decision

Figure 2. Original Cloudflare Support response shared in the developer's X thread. The message attributes the majority of the bill to a Durable Objects alarm loop and says Support cannot issue a credit because the usage originated from application code.
The screenshot also contains an unusual detail. At the bottom, the response states that it was enhanced by Cloudflare Workers AI using Kimi K2.7 from Moonshot AI.
This detail became part of the developer's public criticism of the support process, particularly the perceived repetition of automated responses.
However, the initial support decision should not be confused with the final outcome of the dispute.
Ashley Peacock, associated with Durable Objects at Cloudflare, subsequently acknowledged the case on X and indicated that internal discussions were underway.
The developer replied that payment had already been made to prevent service disruption and expressed willingness to share a positive resolution publicly if one occurred.
On October 9, the developer published that positive resolution: a new Cloudflare Support message apologized for the service experience and stated that $10,701.41 had been processed for refund. The final support response also provided a specific technical diagnosis and preventive recommendations. The outcome is a documented case-specific reversal, not a published promise to refund all AI-generated-code incidents.
The support text was again marked as enhanced by Cloudflare Workers AI using Moonshot AI's Kimi K2.7. That footer is evidence of AI assistance in formatting or drafting the reply, but not proof that the investigation itself lacked human involvement.
What Actually Caused the Bug? The Codex and Git History Evidence
The developer shared a screenshot of a technical investigation connecting the problematic code to local AI coding sessions and repository history.
Unlike general claims that AI coding caused the incident, this screenshot identifies particular code symbols, timestamps, models, and Git commits.
Original Screenshot: Codex Session and Bug Attribution

Figure 3. Original Chinese-language code-attribution screenshot shared in the developer's X discussion. The investigation attributes the initial alarm scheduling change to a Codex session and describes a subsequent Claude-assisted checkpoint modification. The underlying repository and session logs have not been independently audited.
The screenshot contains several technically significant details.
| Investigation detail | Reported finding |
|---|---|
| Coding tool | Codex CLI 0.151.0 |
| Original model | gpt-5.6-sol |
| Original coding session | August 31, 2026, at 14:53 UTC |
| Associated Git commit | f7d4fb0 |
| Commit size | 127 files, approximately 50,211 added lines |
| Relevant code symbols | checkpointRefreshAt and runAlarm |
| Subsequent modification | Commit f6d73a4a, attributed to Claude Fable 5.1 |
| Checkpoint lifetime | 30 days |
| Refresh window | Final seven days before expiration |
| Reported triggering date | September 23, 2026 |
These details are provided by the developer's investigation and should not be interpreted as an independently reproduced root-cause analysis.
Nevertheless, the reported sequence explains how a delayed background-processing failure could occur.
Why Did the Bug Trigger After 23 Days?
The investigation describes checkpoints with a 30-day time-to-live and a seven-day refresh window.
Under that design, a checkpoint created near August 31 would not become eligible for refresh immediately.
Instead, its refresh logic would activate roughly 23 days later, around September 23.
If that refresh operation contained incorrect alarm scheduling behavior, the application might appear healthy during its first three weeks and then begin executing repeatedly once a checkpoint entered the refresh window.
The investigation also identified a September 3 modification involving reusableIdleCheckpoint, which could reuse checkpoints nearing expiration.
According to the screenshot, this later modification was considered a secondary contributor because it could make the problematic lifecycle harder to terminate, rather than being the original source of the alarm scheduling defect.
The incident illustrates an important class of AI-generated software risk: time-dependent bugs that survive ordinary deployment checks and activate only after persistent state reaches a particular age.
Basic unit tests, successful compilation, and several days of normal production behavior are insufficient to rule out this kind of defect.
Cloudflare's Final Technical Diagnosis: PiSessionDO, Date.now(), and SQLite
In the October 9 support explanation shared by the developer, the affected Durable Object is named PiSessionDO. Once a checkpoint entered its refresh window, the alarm() handler scheduled a new alarm at Date.now(), meaning the task could become eligible again immediately. The response described approximately 600 alarm invocations per second and identified persistent SQLite activity as the principal charge source.
This distinction matters: the earlier account of roughly six trillion reads and writes should not be read as six trillion alarm invocations. One handler execution can cause multiple SQL operations and read many rows. Conversely, one setAlarm() operation may itself contribute a billable storage write. Without the full invoice and telemetry, the exact proportion of requests, rows, and duration is not independently known.
Cloudflare's final reply also recognized fixes the developer had already deployed: a 15-minute minimum delay, a retry budget that eventually stops rescheduling, and a regression test. The advice also called for persisting retry counters in Durable Object storage and reviewing alarm and persistent-storage code before deployment. In production, these protections should be tested across restarts, expiration boundaries, and multiple concurrent objects.
The disclosed support response is unusually detailed, but it remains an account of one project. It does not establish a general measured failure rate for Codex, Claude Code, or Cloudflare Durable Objects.
What Are Cloudflare Durable Objects?
Cloudflare Durable Objects are stateful serverless computing components that combine execution with persistent storage.
A conventional Cloudflare Worker is generally designed around request-driven execution. A Durable Object additionally provides a stable identity and coordinated access to application state.
Common applications include:
- Multiplayer games requiring synchronized state.
- Real-time chat rooms and WebSocket applications.
- Collaborative documents and shared editing sessions.
- AI agents maintaining persistent session information.
- Background task scheduling and retry systems.
- Reservation, queue, and inventory coordination.
Durable Objects simplify many infrastructure problems that otherwise require developers to manage dedicated application servers, databases, or message brokers.
However, the platform is metered. Depending on the workload, requests, compute duration, storage operations, and stored data can contribute to the bill.
An application with a low number of users may therefore still generate expensive usage if internal tasks execute too frequently.
How the Durable Objects Alarm API Can Create a Runaway Loop
The Durable Objects Alarms API enables an object to schedule future execution.
Its intended operation follows a simple sequence:
- Application code calls
setAlarm(). - Cloudflare persists the scheduled timestamp.
- When the alarm becomes due, Cloudflare wakes the object.
- The runtime invokes the object's
alarm()handler. - The handler performs work and may schedule another alarm.
This is useful for recurring maintenance, delayed processing, checkpoint refreshes, and retry workflows.
But there is an important operational property: an alarm can execute independently of incoming HTTP requests.
If the alarm handler repeatedly schedules itself without a valid termination condition, the application can continue consuming resources without receiving traffic.
Example of Unsafe Alarm Scheduling
The following example illustrates a potential recurring execution problem. It is not the original code from the reported incident.
import { DurableObject } from 'cloudflare:workers';
export class UnsafeScheduler extends DurableObject {
async alarm() {
// Billable storage work may occur here.
await this.ctx.storage.get('checkpoint');
// Dangerous: immediately schedule another alarm.
await this.ctx.storage.setAlarm(Date.now());
}
}The problem is not simply that setAlarm() exists.
The problem is that the handler schedules another execution regardless of whether useful work remains.
Cloudflare documents that setting an alarm at or before the current time schedules it for execution in the immediate future.
An application can therefore form a repeated cycle of waking, reading or writing storage, and scheduling another wake-up.
Why Automatic Retry Limits Are Not Enough
Cloudflare automatically retries a failed alarm handler up to six times when the handler throws an uncaught exception.
That protection does not automatically stop a successful alarm handler from scheduling itself indefinitely.
There are two distinct mechanisms:
- Platform retries: Cloudflare repeats a failed alarm according to a bounded retry policy.
- Application rescheduling: Business logic voluntarily creates the next alarm, potentially without an effective execution limit.
A recurring job can remain operationally dangerous even when every individual handler invocation completes successfully.
How Could Six Trillion Operations Produce a $10,811 Bill?
Understanding the invoice requires distinguishing billable requests, compute duration, storage reads, and storage writes.
Cloudflare's published Durable Objects pricing for the relevant paid usage categories includes the following rates.
| Billing category | Monthly included usage | Overage rate |
|---|---|---|
| Durable Objects requests | 1 million | $0.15 per million |
| Compute duration | 400,000 GB-seconds | $12.50 per million GB-seconds |
| SQLite rows read | 25 billion | $0.001 per million rows |
| SQLite rows written | 50 million | $1.00 per million rows |
| SQLite storage | 5 GB-month | $0.20 per additional GB-month |
These figures provide pricing context, not a confirmed breakdown of the developer's invoice.
A particularly important difference is that billable SQLite row writes cost 1,000 times more per row than billable row reads under the listed overage rates.
However, large read volumes can still create significant costs.
The Economics of Six Trillion Row Reads
If six trillion operations were entirely billable SQLite row reads, the illustrative storage-read cost would be:
Total rows read: 6,000,000,000,000
Included rows: 25,000,000,000
Billable rows: 5,975,000,000,000
Rate per million rows: $0.001
Estimated read cost: $5,975This is a simplified estimate using one monthly included allowance and the published rate.
It does not establish the actual usage distribution in the case.
If all six trillion operations were rows written instead, the theoretical write charges would approach $6 million after the included allowance.
Neither extreme reproduces the reported $10,811.41 invoice.
The exact amount requires a detailed breakdown of the affected namespaces, storage operations, compute duration, and other billable categories.
Why Database Queries Can Be More Expensive Than They Look
With SQLite-backed Durable Objects, billing is associated with rows read and written rather than only the number of SQL statements executed.
A query returning ten results might scan thousands of rows when the database lacks an appropriate index.
Similarly, repeated checkpoint updates can create substantial write activity even if the application performs very little useful work.
Cloudflare also documents storage-operation costs associated with alarm scheduling and the underlying storage APIs.
Therefore, the number of alarm executions alone is not enough to estimate the total bill.
Developers need visibility into both execution frequency and storage operations per execution.
Why Cloudflare Budget Alerts Do Not Guarantee a Spending Cap
Cloudflare offers account budget alerts for eligible pay-as-you-go accounts.
These alerts notify customers when usage-based spending crosses a configured threshold.
However, Cloudflare states that budget alerts do not automatically stop services or enforce a spending limit.
In July 2026, Cloudflare announced that eligible accounts without an existing alert would progressively receive a default $10 budget notification.
The associated usage information is processed on a periodic basis rather than providing an instantaneous shutdown mechanism.
Consequently, an application can accumulate additional charges before an alert is generated, delivered, or acted upon.
| Protection mechanism | Primary purpose | Limitation |
|---|---|---|
| Budget alert | Notify account owners about rising charges | Does not terminate billable execution |
| Alarm retry limit | Bound automatic retries following failures | Does not prevent successful self-rescheduling |
| Application execution quota | Limit repeated business operations | Must be implemented and enforced correctly |
| External monitoring | Detect abnormal usage trends | May operate with delayed metrics |
| Emergency kill switch | Disable further processing | Must remain functional during application failures |
| Hard spending cap (Cloudflare prototype, October 2026) | Enforce a maximum permitted spend once available | Not generally released as of October 10, 2026; exact coverage and behavior remain to be confirmed |
The key difference is between detecting excessive spending and preventing additional spending.
Budget notifications are useful, but they should not be treated as financial circuit breakers.
Cloudflare Plans Hard Spending Caps for Q4 2026
In its October 2, 2026 product-accessibility update, Cloudflare explicitly said that hard spending caps were being prototyped, with early availability targeted for Q4 2026. The announcement concerned Cloudflare's wider pay-as-you-go billing experience, not merely an alarm-specific runtime limit. As of October 10, a broadly available account-level cap and its exact product coverage could not be confirmed.
The same post notes a different timeline for Enterprise-contract customers, whose billing arrangements are more varied. Separately, AI Gateway offers product-specific spend limits; those must not be confused with a global limit that automatically covers Workers, Durable Objects, D1, R2, and every other metered product.
The safer current strategy is to combine the official account budget alerts with application-level limits and, where appropriate, independent shutdown automation. Alerts may be delayed and do not cap charges.
How to Prevent Durable Objects Alarm Loops
The safest design combines scheduling limits, persistent execution quotas, bounded database work, idempotency, and independent monitoring.
1. Check Whether an Alarm Already Exists
Cloudflare specifically recommends checking existing alarm state before scheduling alarms during Durable Object initialization.
An object may be recreated after inactivity when a previously scheduled alarm becomes due.
Its constructor runs before the alarm handler, so blindly setting another alarm during initialization can interfere with the pending execution.
The scheduling code should therefore inspect getAlarm() before calling setAlarm() when the application requires only one pending task.
2. Add Minimum Intervals and Execution Limits
Recurring jobs should have explicit limits on how frequently they can execute.
A minimum delay prevents immediate repeated scheduling, while a persistent execution counter limits total executions over time.
The following example demonstrates basic safeguards:
import { DurableObject } from 'cloudflare:workers';
const MIN_DELAY_MS = 60_000;
const MAX_RUNS_PER_DAY = 300;
export class SafeScheduler extends DurableObject {
async scheduleIfNeeded() {
const storage = this.ctx.storage;
if (await storage.get('paused')) return;
if ((await storage.getAlarm()) !== null) return;
await storage.setAlarm(Date.now() + MIN_DELAY_MS);
}
async alarm() {
const storage = this.ctx.storage;
if (await storage.get('paused')) return;
const day = new Date().toISOString().slice(0, 10);
const previous =
(await storage.get<{ day: string; runs: number }>('usage'))
?? { day, runs: 0 };
const runs = previous.day === day
? previous.runs
: 0;
if (runs >= MAX_RUNS_PER_DAY) {
await storage.put('paused', true);
return;
}
await storage.put('usage', {
day,
runs: runs + 1
});
const hasMoreWork = await this.processNextBatch();
if (hasMoreWork) {
await storage.setAlarm(Date.now() + MIN_DELAY_MS);
}
}
async processNextBatch(): Promise<boolean> {
// Replace with bounded, idempotent business logic.
return false;
}
}This code is an illustrative defensive pattern, not a complete production implementation.
It prevents voluntary rescheduling after the per-object daily execution threshold is reached.
It also avoids scheduling another alarm when the application reports that no further work remains.
However, per-object execution limits do not automatically provide an account-wide cost cap.
If a system contains thousands of Durable Objects, aggregate usage may still become substantial.
A production application should additionally restrict the number of active objects, maximum work per invocation, and total jobs across the account.
3. Make Background Operations Idempotent
Durable Objects alarms use at-least-once execution semantics.
If processing fails and is retried, the same logical operation may execute again.
Applications should use durable job identifiers, completion markers, and appropriate transactional boundaries to prevent duplicate effects.
This is especially important for payment processing, external API calls, and persistent state updates.
4. Limit Database Work Per Invocation
Even a small number of alarms can become expensive if every execution performs an unbounded query.
Recommended safeguards include:
- Add indexes for frequently queried fields.
- Avoid full-table scans inside recurring maintenance jobs.
- Use pagination and bounded batch sizes.
- Measure rows read and written, not merely query counts.
- Avoid rewriting unchanged checkpoint metadata.
- Stop processing when the job's cost or operation budget is exhausted.
5. Provide an Emergency Kill Switch
Applications should support disabling background processing independently of the normal scheduling workflow.
A kill switch might use centrally controlled configuration, persistent object state, or an operational control plane.
For emergency recovery, deleteAlarm() can remove a pending alarm, although it does not cancel an alarm handler that is already executing.
Developers should test the shutdown mechanism before an incident occurs.
How to Test AI-Generated Scheduling Code
The reported 23-day delay highlights the importance of testing future state transitions.
Cloudflare provides a runDurableObjectAlarm() testing helper that allows developers to trigger scheduled alarms without waiting for real time to pass.
A thorough test suite should cover:
| Scenario | Expected behavior |
|---|---|
| No pending work | No recurring alarm is created |
| Existing alarm | Scheduling avoids unnecessary duplication |
| Job completes | Alarm processing terminates |
| Handler throws | Retry behavior is bounded and safe |
| Object restarts | Persistent execution limits remain effective |
| Daily quota reached | Further voluntary scheduling stops |
| Checkpoint approaches expiration | Refresh logic executes without cycling indefinitely |
| Many objects execute simultaneously | Aggregate operation quotas remain enforced |
| Emergency pause enabled | Expensive processing stops |
Developers should explicitly simulate delayed conditions around checkpoint expiration, refresh windows, and stale persisted state.
An application that works correctly on deployment day may fail when a state transition occurs weeks later.
How to Monitor Durable Objects Spending
Cloudflare provides Durable Objects metrics and analytics for investigating usage and performance.
The dashboard and GraphQL Analytics API can support custom monitoring systems.
Useful signals include:
- Alarm executions per object and namespace.
- Storage rows read and written.
- Compute duration and request activity.
- Sudden increases in background usage.
- Repeated execution without corresponding user activity.
- Cost changes relative to historical baselines.
- Unusually frequent checkpoint refresh operations.
One particularly valuable rule is detecting high billable activity in applications with almost no external traffic.
For example, if a test project normally performs only a few scheduled operations per hour, a sudden jump to thousands of executions deserves immediate investigation.
Monitoring should ideally trigger automated protective action through an independent control mechanism.
However, analytics data may arrive with a delay, so monitoring alone cannot guarantee an exact maximum bill.
What to Do When a Cloudflare Bill Suddenly Spikes
When unexpected charges appear, developers should prioritize stopping additional usage and preserving evidence.
Step 1: Identify the Expensive Service
Inspect Cloudflare Billing and Billable Usage to determine whether the increase originates from Durable Objects, Workers, D1, R2, or another product.
Step 2: Find the Responsible Namespace
Review Durable Objects metrics, recent deployments, and relevant logs to identify unusual execution patterns.
Step 3: Disable New Work
Stop creating additional jobs, disable the scheduling path, and activate the application's emergency pause mechanism.
Delete pending alarms where appropriate after understanding the application's state requirements.
Step 4: Preserve Evidence
Capture invoice details, usage metrics, deployment timestamps, Git commits, scheduling code, and relevant support correspondence.
Step 5: Request a Billing Review
Explain the timeline, affected service, suspected cause, mitigation steps, and financial impact.
A goodwill adjustment may be requested, but it should not be assumed or represented as guaranteed.
Step 6: Prevent Recurrence
Implement execution quotas, scheduled-task tests, cost monitoring, and independent shutdown controls before enabling the affected workload again.
Have Similar Cloudflare Billing Incidents Happened Before?
Several developers have publicly described unexpected Durable Objects bills associated with runaway tasks or excessive database operations.
| Publicly reported case | Amount | Reported cause | Reported outcome |
|---|---|---|---|
| shmily7, October 2026 | $10,811.41 | Durable Objects alarm loop | $10,701.41 refund processed on October 9; receipt pending at time of post |
| Standard Agents, August 2026 | $8,846 | Two Durable Objects entering loops | Developer subsequently reported a bill adjustment |
| Jonathan Mann, October 2026 | $4,483.74 | Excessive Durable Objects reads | Cloudflare personnel engaged publicly |
The Standard Agents case is particularly relevant.
In August 2026, developer Justin Schroeder reported an $8,846 bill caused by two Durable Objects running uncontrolled loops.
On August 17, he stated that Cloudflare had adjusted the bill.
The shmily7 case and the Standard Agents example demonstrate that account adjustments can occur after an initial incident, but neither establishes a universal refund policy.
Individual incidents also should not be used to estimate how frequently Cloudflare customers experience runaway billing. The published reports represent a self-selected group of unusual cases.
Developer and Community Reactions: Praise, Criticism, and Calls for Hard Caps
Public reactions to the October 9 resolution post were not uniformly positive or negative. The most persistent divide concerned who should prevent a runaway infrastructure bill: the cloud provider through enforced limits, the developer through careful review, or both.
X: Gratitude for the Refund, but a Demand for Better Default Protections
- @DbgKinggg praised the developer for accepting responsibility and Cloudflare for granting relief, describing a positive public-relations outcome. The same comment asked Cloudflare to add a configurable usage hard cap.
- @yiqiangchen_ argued that AI-assisted application development is realistic for small teams that lack the resources for extensive manual code review. The more practical response, in this view, is designing system boundaries that keep failures contained.
- @tangxiaolv7 welcomed Cloudflare's generosity but said alerts alone are not enough; users need the ability to enforce an actual spending ceiling.
- @deslopper placed more responsibility on the developer, specifically criticizing the absence of configured billing alerts.
- @shellexy asked whether the successful resolution would persuade the developer to continue using Cloudflare. The final migration decision was not yet established in the source material.
These are selected identifiable comments, not a statistically representative poll. The comments were publicly indexed and discussed in the surrounding October 9 thread.
Hacker News: Spending Caps Versus Developer Accountability
The related Hacker News discussion, Serverless Horrors $10,811.41, exposed several additional perspectives:
- joshstrange suggested safeguards based on historical account usage, with staged warnings or automatic stop mechanisms at increasing spending thresholds.
- SwellJoe said most personal projects could run on approximately $6–$12-per-month VMs, arguing that predictable fixed-resource infrastructure reduces exposure to per-operation cloud charges. That is an individual example, not a universal VPS pricing guarantee.
- zmj reported encountering a similar mistake: a Durable Objects alarm set to a past time repeatedly fired; according to the commenter, Claude identified it through log inspection within minutes.
- hoppp argued that deploying code without reading it is effectively putting one's wallet at risk.
One recurring theme is that software correctness, financial risk, and provider design are different responsibilities. A project can pass functional testing, have almost no users, and still require a spending circuit breaker.
Reddit: Why Hobby Developers Fear Usage-Based Infrastructure
In the r/CloudFlare discussion on preventing a bill assassin, users explored ways to inspect Cloudflare projects for expensive loops. Several comments expressed discomfort with the possibility of a hobby app generating a bill far beyond the owner's budget; others pointed out the irony of asking AI to audit risks introduced by AI-generated code.
The criticism should not be reduced to an anti-AI or anti-Cloudflare consensus. Across platforms, commenters generally treated preventive execution limits, hard caps, and independently verifiable safeguards as more durable solutions than relying on support goodwill after a five-figure invoice.
Cloudflare vs VPS: Is Self-Hosting Safer?
Before the October 9 refund update, the developer announced plans to migrate projects away from Cloudflare toward VPS self-hosting. The later resolution post expressed gratitude for the platform's rapid-shipping capabilities, so the final migration decision should not be assumed.
This is a reasonable option for workloads that require long-running background processes and predictable resource allocation.
However, self-hosting introduces different operational responsibilities.
| Factor | Cloudflare Durable Objects | Self-hosted VPS |
|---|---|---|
| Scaling | Managed infrastructure | Developer-managed capacity |
| Compute billing | Metered usage | Usually fixed resource allocation |
| Storage operations | Potentially metered per operation | Usually included within provisioned resources |
| Background jobs | Alarm API | Cron, task queues, or workers |
| Maintenance | Managed platform | Developer responsibility |
| Failure consequences | Potential usage-based charges | Potential resource exhaustion and outages |
| Global distribution | Managed platform capabilities | Requires additional architecture |
A fixed-price VPS can reduce exposure to some forms of per-operation billing.
But it does not eliminate infinite loops. A runaway background process can still exhaust CPU, memory, disk capacity, or available network traffic.
A hybrid architecture may be more practical for smaller development teams:
- Use Cloudflare CDN and static hosting where appropriate.
- Keep predictable request-driven workloads on Workers when their pricing is suitable.
- Move long-running or potentially unbounded jobs to infrastructure with explicit resource budgets.
- Use queues, execution limits, and cost monitoring across both environments.
The best deployment model depends on workload behavior rather than a blanket assumption that serverless or VPS hosting is inherently safer.
A Reusable Codex and Claude Code Infrastructure Safety Prompt
AI coding agents should be instructed to review the financial behavior of generated infrastructure code, not just its functional correctness.
The following prompt can be used during code review:
Audit this repository for runaway execution,
unbounded background tasks, and unexpected
usage-based infrastructure costs.
Pay special attention to:
1. Durable Objects alarms and recurring jobs.
2. Retry loops and recursive scheduling.
3. Database queries that scan excessive rows.
4. Background jobs without active users.
5. TTL, expiration, and checkpoint refresh behavior.
6. Duplicate execution and idempotency failures.
7. Missing per-object and global execution quotas.
8. Emergency kill-switch availability.
9. Delayed bugs that may activate weeks later.
10. Worst-case billable operations and cost.
For each identified risk:
- Identify the exact files and functions.
- Explain how the failure could occur.
- Estimate potentially billable operations.
- Recommend concrete execution limits.
- Add tests for time-dependent edge cases.
- Explain the remaining risk after mitigation.
Do not assume a successful build or passing
unit tests prove operational safety.
Do not deploy or execute paid workloads.This type of review should be applied to Codex, Claude Code, and other AI coding systems alike.
A coding agent can help identify dangerous loops, but independent tests and operational safeguards remain necessary.
Frequently Asked Questions
Can Cloudflare charge an application with no users?
Yes. Durable Objects alarms can execute without incoming user requests. A recurring background task can generate storage and compute usage even when an application has no active users.
Did Codex cause the $10,811 Cloudflare bill?
The developer publicly attributed the original faulty scheduling logic to Codex and shared an investigation screenshot containing model, session, and Git details. The complete underlying repository has not been independently audited, so the evidence supports a reported attribution rather than a fully reproduced technical verdict.
Why did the bug take 23 days to trigger?
The developer's investigation associated the delay with a 30-day checkpoint lifetime and a seven-day refresh window. The problematic scheduling path reportedly became active when checkpoints entered that refresh period.
Did Cloudflare refund the $10,811 bill?
Partially relative to the total invoice, but in full for the affected Durable Objects charges: an initial support screenshot shows a refusal to grant billing credit, while the developer's October 9 update reproduces a later Support message stating that $10,701.41 was processed for refund. That leaves a $110 difference from the displayed $10,811.41 invoice. The refund covered incident-period Durable Objects requests, duration, rows read, and rows written. The author said the refund was still pending arrival as of that post. The exact remaining invoice components were not publicly itemized.
Does Cloudflare provide a hard spending cap for Durable Objects?
As of October 10, 2026, Cloudflare budget alerts notify users but do not automatically cap spending or disable billable activity. In an October 2 announcement, Cloudflare said it was prototyping hard spending caps, targeting early availability in Q4 2026. The final account-level rollout date and exact Durable Objects coverage had not been confirmed. Product-specific AI Gateway spend limits are not equivalent to an account-wide cap.
Would using Claude Code instead of Codex prevent this incident?
Not necessarily. Both coding agents can generate scheduling and database logic requiring independent review. Execution budgets, bounded retries, testing, and monitoring are more reliable safeguards than choosing a coding tool solely on reputation.
Can the original screenshots and refund statement be viewed independently?
Yes. The original invoice, attribution, and initial Support screenshots are embedded directly from X's pbs.twimg.com media host. Readers can also inspect the October 6 incident post, October 8 update, and the October 9 refund and technical explanation. The published final Support text is an account-holder disclosure; it is not independent access to Cloudflare's internal billing records.
AI Prompt: Check Your Cloudflare Project for Hidden Billing Risks
A $10,811 Cloudflare bill demonstrates why AI-generated code needs more than functional testing. Scheduled tasks, database operations, and retry loops can quietly accumulate charges even when an application has no active users.
The following prompt can help developers use ChatGPT, Codex, or Claude Code to identify potential infrastructure billing risks before deploying their applications.
Copy and paste this prompt into your AI coding assistant:
Act as a senior Cloudflare infrastructure engineer
and cloud cost optimization specialist.
Audit my project for hidden Cloudflare billing risks,
especially those that could result in unexpected
charges of hundreds or thousands of dollars.
Focus on:
1. Durable Objects alarm loops and recursive scheduling
2. Excessive D1 or Durable Objects database reads/writes
3. Infinite retries and background execution loops
4. Workers CPU usage and unexpected invocations
5. R2 storage and API operation costs
6. Tasks executing without active users
7. Delayed bugs triggered by TTL or expiration logic
8. Missing rate limits, quotas, and kill switches
For each issue, provide:
- Affected file and function
- Severity: Critical, High, Medium, or Low
- How the bug could trigger unexpected charges
- Estimated cost exposure with stated assumptions
- Recommended fix
- A test to verify the fix
Also analyze the worst-case scenario if the
application runs unattended for 24 hours.
Do not invent code or billing metrics.
Clearly identify anything that cannot be verified.
End with a standalone summary paragraph explaining
the project's overall financial risk and the
three most important preventive actions.
Here is my code or project repository:
[PASTE CODE OR REPOSITORY CONTEXT HERE]Important: An AI-generated audit cannot guarantee that an application is free from billing risks. Developers should verify suggested fixes, inspect actual Cloudflare usage metrics, and implement independent execution limits before deploying changes to production.
Conclusion
The $10,811.41 Cloudflare bill became more than a cautionary tale about Vibe Coding when the developer published a decisive October 9, 2026 update. Cloudflare Support stated that a $10,701.41 refund had been processed, covering the Durable Objects usage generated between September 23 and October 6. The developer was still waiting for the funds to appear, and the difference from the original invoice was not fully itemized in public.
The follow-up also supplied a concrete technical diagnosis. After a checkpoint entered its refresh window, the PiSessionDO alarm logic repeatedly scheduled execution at Date.now(), reportedly reaching approximately 600 invocations per second. Storage reads and writes, rather than active user traffic, drove the unexpected charges. The reported corrective changes — a minimum delay, persistent retry budget, and regression testing — directly address that failure mode.
Community discussion revealed a broader market issue. Developers disagreed about how much blame belongs to an AI coding tool or a person shipping code without review, but the strongest recurring request was for enforceable spending limits. Cloudflare's planned Q4 2026 early availability for hard spending caps is therefore an important development to follow, not an already delivered fix.
Practical next step: inspect every setAlarm() call, retry loop, scheduled job, and database operation in deployed projects — including experiments that no longer receive traffic. Configure budget alerts, establish per-object and account-level workload limits, test delayed state transitions, and make the emergency pause mechanism verifiable before using metered infrastructure at scale.
Primary references: October 9 incident resolution · Cloudflare Durable Objects Alarms · Durable Objects pricing · Cloudflare spending-cap roadmap.
Continue Reading
More articles connected to the same themes, protocols, and tools.
Referenced Tools
Browse entries that are adjacent to the topics covered in this article.









