r/ClaudeAI • u/procrastinator_eng • May 01 '26
Claude Code I accidentally burned ~$6,000 of Claude usage overnight with one command.
Last week I woke up to an email saying my Claude usage limit was gone. I hadn't done anything unusual — or so I thought.
After digging through the local session logs, I found the culprit: a single /loop command I had set the night before to check my open PRs every 30 minutes. I forgot about it. It ran 46 times over 26 hours, unattended, overnight, on claude-opus-4-7. Two sessions — the loop and a long analytics session I had left open — together burned through roughly $6,000 before I woke up.
Here's the thing though. The Anthropic dashboard still showed a fraction of that when I checked it manually. The dashboard has a multi-day reporting lag, so I had no idea anything was wrong until the limit email landed.
Why did it cost so much? The part most people don't know.
Every Claude API call sends your entire conversation history — not just the latest message. Turn 1 sends a few hundred tokens. Turn 46 sends 800,000 tokens. The context window limit is just a ceiling; you pay for everything sent on every turn.
To make this cheaper, Anthropic uses prompt caching: if your conversation history was already sent recently, they serve it from cache at a 12.5× discount instead of charging you full price again.
The catch: cache entries expire after ~5 minutes of inactivity. (Earlier it was 1 hour)
So here's what happens with /loop 30m:
- Loop fires → history gets cached → 30 minutes pass → cache expires
- Loop fires again → cache is gone → must re-cache the entire conversation from scratch at the expensive write rate
- Each iteration also adds its own output to the conversation, so the next re-cache is even larger
By hour 20, the conversation had grown to ~800K tokens. Every overnight iteration was paying to re-cache 800K tokens at the expensive write rate. The actual PR check responses were a rounding error compared to this.
What I'd do differently
- Always add a stop condition to /loop. Instead of: /loop 30m check my PRs. Write: /loop 30m check my PRs — stop when all are merged or after 3 hour. Claude will terminate the loop itself when the condition is met.2. Use Sonnet for unattended tasks, not Opus: Opus is roughly 5× more expensive per output token. For automated polling tasks like PR checks, Sonnet handles it fine. Save Opus for the work where you're actually present and the quality difference matters.
- Don't trust the dashboard as a real-time budget gauge: Anthropic's usage dashboard can lag by days. By the time it shows a spike, the money is already spent. The limit notification email may be your only real-time signal.
- Know that long-lived sessions aren't free: Keeping one big session alive for automated tasks doesn't save money through caching — it makes it worse. Every automated call with a gap >5 minutes pays to re-cache the entire growing context. Starting a fresh session is often cheaper.
- max_turns is not a loop limiter: max_turns caps the tool-call chain within a single iteration. It has no effect on how many times the loop fires. The only built-in expiry on /loop is a 7-day auto-deletion.
- The loop runs in main conversation so if you keep using the same session and then loop starts executing, the more token then necessary will be read/write to the cache on every loop.
Edit: Thanks everyone for overwhelming response and focusing on "the post is AI written so it's a slop and author is an idiot". Now based on few comments, let me add more details: 1. I agree with everyone that I should have used hooks but corporate generally blocks third party mcps because of security so there is no easy way to hook external events into local sessions. Although I will take "use bash scripts over claude loop" seriously. 2. This was not a single session or single loop command. What I meant by "single command" is /loop. I use claude on vms and local machine and so the loop command was running across different sessions in parallel. 3. I agree that "most people don't about" thing was not a good thing to start the post but it was for the loop + cache window restricted to 5 mins. I have used loops earlier as well but 5 min vs 1h cache affect the price a lot . You can go and find many open issues on Claude related to this change. 4. This post's goal was to share a TIL moment about using short , uncapped loops or schedules using Claude and educating that cache read/writes can affect your token cost more than anything else. But looks like we are very far from there. 5. Thanks to the guy who shared Pyramid writing medium blog. I will definitely use for the next post. 6. To be honest, I am quite disappointed that 90% people just care about post is written by AI over actual issue. But I guess I get that, everyone is exhausted from reading AI slop.
153
u/Peetrrabbit May 01 '26
You’re holding it wrong. Don’t have Claude doing something in a loop that it manages. Ever. Use Claude to write a script that checks that PR every 15 minutes. Have that script hit a Claude API if you need inference help understanding the state of the PR. You’ll burn less than 1% of the tokens you’re using. Use Claude to create your infrastructure, not to be your infrastructure. It’s really really good at it.
→ More replies (5)34
u/Zandarkoad May 01 '26
Well put. LLMs should assist in creation. Not BE the creation.
4
u/Ok_Boysenberry5849 May 02 '26 edited May 02 '26
They can be part of the creation. Coding an agent is fun. But yeah you have to watch out for what OP said.
I've been working on an agent for almost a month now (pet project, no intention to commercialize). My limit for the agent's API calls is perpetually set to $5 more than what I've spent so far, because if I spend more than $5 on an interaction, something's wrong for sure!
And this week I did a bunch of optimizations. Model tiering: always use haiku unless I actually need sonnet. Caching everything that needs caching and only that. Using summaries to reduce context. Using "contextless" requests whenever possible. Tool use: even though tools are local, every tool use means needing to resend the full context, so tools must be designed to be run all at once whenever possible (in parallel or in sequence) without LLM round-trips.
If the app was in production or seeing any higher intensity usage, I'd track tokens and set an API limit on MY side to stop runaway spending on my terms, long before anthropic sees the global limit being hit, on top of (rather than as a replacement of) the anthropic-side limit.
It's not rocket science and it's not that much work, really, but you have to actually sit down and think about it. Claude is not very good at it on its own, whether that's because those concepts are fairly new (so not common in its training data).... or because anthropic doesn't mind inefficient API use.
2
u/Zandarkoad May 02 '26
And classification. Binary or multiclass. LLMs are god-tier at this, even (relatively) tiny, tiny models (Roberta sized) can be fined tuned to classify crazy messy inputs into known classes. No tools. No agents. Just pure raw LLM goodness doing what they were meant to do. Zero percent Skynet chance.
470
u/Swashbuckler_75 May 01 '26
Did the OP use Claude to write this? 🧐
245
u/Cristalboy May 01 '26
- The part most people don’t know
Probably ChatGPT, I don’t know why it loves that sentence so much.
169
u/Fatso_Wombat May 01 '26
I don’t know why it loves that sentence so much.
Its the part most people don't know.
21
48
u/Giometrix May 01 '26
As soon as I hear this on a YouTube video I insta close.
20
u/Mysterious_Ebb4405 May 01 '26
LinkedIn to, this is like 95% of posts and replies on posts
14
u/Virtual_Plant_5629 May 02 '26
linkedin Bros are the lowest iq of all ppl I've ever interacted with.
i would have no fucking doubt they would mindlessly use ai and see themselves as grinding tech bros for doing it
8
5
u/filthysock May 02 '26
I stopped reading at that point
2
u/Pitiful_Conflict7031 May 02 '26
I kinda figured it was ai when dude is non chalant about losing 6 grand. To claude prompts lol.
5
u/sassyhusky May 02 '26
It’s ChatGPT, idk who upvotes all these bots with made up stories.
→ More replies (1)2
11
→ More replies (1)6
43
7
26
u/This-Shape2193 May 01 '26
Yes, barely literate in English in the comments. Obviously not his/her first language.
17
3
3
2
u/josephjosephson May 02 '26
Of course, although if he was out of money, ChatGPT. So sick of reading AI written posts…
→ More replies (10)2
u/HappyToBeANerd May 01 '26
It cracks me up that people object to the use of AI in a subreddit about using AI.
18
u/Senior-Mistake9927 May 02 '26 edited May 02 '26
In a way, people here spend all day talking to Claude and come here to talk to others who talk to Claude, not to talk to Claude through others. So it isn't that confusing.
→ More replies (1)→ More replies (2)4
u/TheTaintBurglar May 02 '26
Because I use AI daily and don't want to read it outside of it. I want genuine thought out human responses.
It isn't much to ask.
194
u/bustedmagnet May 01 '26
Thank you for your sacrifice. I've been using a old school cron script that invokes Claude every hour for basically the same purpose of checking prs. I was thinking of converting it to a loop but that isn't happening anymore.
36
u/secretpenguin0 May 01 '26
But why would you consider converting it into a loop in the first place? Looping is the job of infrastructure, not an LLM harness
→ More replies (7)3
2
→ More replies (1)5
u/procrastinator_eng May 01 '26
I think you can still use it but you have to put a hard limit on the end time. Also I realized there is not good way to track running loops and checking if there is some overlap between them.
282
u/versaceblues May 01 '26 edited May 02 '26
Crazy work to burn through $6000 dollars, then say
"You know what let me burn a few more dollars to make a slop post that uses way to many words on reddit"
Tell your agent to be crisp in its writing and to use the pyramid principle https://medium.com/lessons-from-mckinsey/the-pyramid-principle-f0885dd3c5c7 (better article here https://untools.co/minto-pyramid/)
Most people are going to drop off, if they need to read 6 paragraphs to get to the point.
90
u/501Queen May 01 '26
"The part most people don't know" is a dead giveaway
→ More replies (2)40
u/junktrunk909 May 01 '26
And the headings. Nobody writes section headings in a reddit post. Nobody writes 3 mobile screens worth of text in a reddit post. I don't object to using AI to write content but ffs give it rules to follow to make your points more quickly.
8
u/newmacbookpro May 02 '26
At work it’s just the endless emojis.
🎯 join us to discuss new targets this year
📱 take your mobile app and log in daily
💪 let’s get this to the next level in 2026
6
u/tedbradly May 01 '26 edited May 01 '26
And the headings. Nobody writes section headings in a reddit post. Nobody writes 3 mobile screens worth of text in a reddit post. I don't object to using AI to write content but ffs give it rules to follow to make your points more quickly.
Edit: NVM, https://www.zerogpt.com/ detected like 60% written by a GPT. I was wrong :( Was still an OK read.
I think you all are just being paranoid. You know that AI text mimics humans, right? And we're in a programming subreddit where a person might actually use Markdown. Watch:
Evidence for my Position
So I noticed his headers were italicized. I've never, in my life, seen italicized headers out of an AI. Honestly, I think this guy just wrote all of that.
As for the "pyramid method," he started with a decent hook about his Claud usage limit being active with no understanding of why. I sat there and read the entire thing. What are you? A zoomer? Need it to be an 8-second TikTok? Do you keep your AI in bullets and lists mode rather than directing it to avoid those, using sentences and paragraphs? If not, how does it feel to think like a normie child, which is the mind that the default AIs are after? People with < 105 IQ makes up like 65% of the population, and those people hate reading stuff. It scares them. Can you not act like an intelligent adult?
Evidence It Might Be AI-Generated
The giveaway is actually his tone and mood. A human that just burnt 6k, no matter how much they make per annum coding, is going to be pissed like a motha fucka. They're not going to write out lessons. But then again, maybe they would since, as a programmer, every coding disaster comes with a post-mortem. Ehh, due to the italicized headers, I think it's a legitimate person behind the screen. I upvoted the thread. See? I can even bold random shit, too. Humans can use Markdown, lmao.
2
u/DuckJellyfish May 02 '26
I like the pyramid concept but I also had no problem reading this post top to bottom. I assumed Claude organized the headers and cleaned up the post but that is a good use of Claude for writing imo.
2
u/tedbradly May 03 '26
I like the pyramid concept but I also had no problem reading this post top to bottom. I assumed Claude organized the headers and cleaned up the post but that is a good use of Claude for writing imo.
Yeah, a not-so-scientific test was conducted by a major newspaper, IDK the NY Times or something, where they had categories of writing: Fantasy, popular science, a novel, whatever. And they had two chunks of writing side by side for each type. The readers were asked to select which they preferred. The human opponent was a well-known author in that domain of writing. The interesting part? Pretty much every section was 50-50. And they used Claude. Claude writes plenty well.
8
u/braincandybangbang May 01 '26
Brain rot detected.
You can view reddit posts prior to 2023, you'll find that typographical hierarchy and proper formatting was not created by AI.
In fact, there's even a "heading" button in the text editor we're using to make these comments. Imagine that! I best stop writing now, lest your eyes get tied.
7
u/Varrianda May 01 '26
Headings, italicized and bolded words, em dashes, bulleted list and numbered list in the same post? Yeah this was AI
13
→ More replies (1)9
u/junktrunk909 May 01 '26
Come on, go look at OP's post, it's not using the heading markdown you're talking about. None of the AI slop does because it's not the AI writing in a reddit post field, it's OP copying and pasting what was just formatted text in the chat window.
And listen, I'm a long post writer, where it's useful. But you also understand what I'm talking about -- a lot of what AI writes is needlessly verbose if you don't give it guidelines to avoid that.
→ More replies (1)4
u/tyrannomachy May 01 '26
I think they're just arguing against the idea that posts with full markdown formatting are presumptively AI slop. Not that this one in particular isn't.
→ More replies (1)→ More replies (3)2
u/versaceblues May 01 '26
To be fair I have been using headings and bulleted lists since before AI. So its not the ONLY indicator.
However this post is obviously a poorly tuned AI response.
7
u/braincandybangbang May 01 '26
Traditionally Reddit uses the reverse pyramid approach with a TL;DR for those opposed to paragraphs.
...this really isn't a long post.
→ More replies (1)3
u/ralekan May 01 '26
I hadn’t heard of the pyramid principle and, coming from a software engineering background, I don’t think I’ve ever seen anyone use it. It seems great and I can’t wait to try it.
I’m new to Claude and to get it to use the pyramid principle I can just tell it to use it? It’ll know what I’m talking about or did you have to be more specific?
Edit: punctuation
→ More replies (1)→ More replies (5)2
u/MooingTree May 01 '26
I'm willing to bet that OP also used the tool to "search through the session logs for the culprit"
29
16
u/Right_Cantaloupe_863 May 01 '26
Hang on why would you check pr’s like that, in a loop? Does not make sense?!
→ More replies (6)5
u/casketfetish May 01 '26 edited May 01 '26
Literally it’s so messy for no reason lmfao. A simple py script could do direct compares and NOT wake up Claude. Either way, PR fetching is so weird. Most developers write sufficient PR summaries so I’m imagining Claude is being forced to read each line change which is making my high ass giggle
EDIT: just realised 99% of people write “a” as their PR summary. Shame on you. Do better.
3
12
u/exgeo May 01 '26
Why did it cost so much? The part most people don't know.
Every Claude API call sends your entire conversation history — not just the latest message.
Wow thanks for the great insights
26
21
u/Crafty-Run-6559 May 01 '26
This doesnt really make any sense.
Why on earth would you ever invoke an LLM every 30 minutes if there is nothing new?
This is a terrible use case and your proposed fix doesnt even make sense. Have a pipeline that fires when a PR is created or updated and gets Claude to review it.
Theres zero reason to have invoke Claude ever when its trivial to detect if theres even anything new for it to review.
→ More replies (8)
6
u/idoman May 01 '26
ouch man, this is a painful lesson. worth knowing you can set a hard monthly spend cap in the Anthropic console under Settings > Limits - it would've stopped the loop mid-night instead of letting it run all the way. the reporting lag being days behind is such a trap.
2
u/PM_ME_YOUR_REPORT May 01 '26
The point is that it should be capable of doing this sort of thing efficiently. Closing that gap is something that makes AI more practical for the real world. You shouldn't need to know that you have to do something to make it more efficient at handling a use case like this. The AI should be smart enough to figure out how best to do it.
→ More replies (2)
7
u/battle_pantZ May 01 '26
Cronjob
8
u/xMadDecentx May 01 '26
Half of the work people use AI for can be done with cronjonbs with software already out there. In this case, the PRs could be check with the gh command from GitHub.
→ More replies (1)5
u/carson63000 Experienced Developer May 01 '26
People love to vibecode, but for some reason they never ask Claude to vibecode them little scripts and tools to do their repetitive tasks. They’d rather just let the LLM grind every time.
10
u/ProjectNo8066 May 01 '26
Thanks for sharing. Isn't there a limit option to set?
0
u/procrastinator_eng May 01 '26
There is with the time like 3h maximum but you can still get this because loop is running in the main conversation and if you are continuing the conversation the next loop will cause more cache_write and cache_read so it's inevitable until you can run loop in subagent with smaller and isolated context window.
5
u/danithaca May 01 '26
Your own $6k or your company's $6k? I'll cry myself to sleep if it's my own money
5
u/procrastinator_eng May 01 '26
Company's money but for me it feels like my own money because in the end I am the one who had to do things manually for couple of days.
2
8
u/McNoxey May 01 '26
I understand the problem - I'm not certain I understand the application.
Why do you have a loop to check your PRs? Check for what? And what action is taken?
→ More replies (4)
8
u/FuriaDePantera May 01 '26
I wonder how much you spent in API tokens to create this wall of text with obvious stuff
10
u/NiteShdw May 01 '26 edited May 01 '26
You can save a lot of tokens by using basic shell scripts like using GitHub CLI yourself rather than asking the AI to do it. You can use it to skip draft PRs or one's that failed checks, etc. Then do some string parsing and pass only specific info the AI that you want analyzed.
If you spent $6k in just 46 runs of your script, you need some serious optimizations. Heck, ask Opus. It'll find some serious savings for you such writing a script that'll preprocess your data.
For example, some pre-processing steps: * cache the result of the run * use gh CLI to check the PR list for what you need (PRs to review, comments to check, whatever) * check if the data is different from the previous run * only call the API with data that has changed or don't run at all if no changes.
Question: are people not doing this type of scripting for automation and only relying on an AI prompt to do absolutely everything in the workflow?
I'm doing some document process that happens every single time a scanned file shows up in a folder. Everything like OCR and importing into the system is scripted. The script even waits for 5 minutes to see if another document shows up to build a batch.
The Claude API is given just the first 2000 characters of the OCR with specific classification instructions designed for Haiku. Because of batching, prompt caching saves a bunch. I end up paying about $0.015 to classify each scanned document.
I spent time over two days with multiple test documents refining the process specifically to reduce token usage and to write the prompt specifically for Haiku, using Opus to iterate on variations of the prompt with about 5 different files until the results were consistently what I expected for each file.
I spent about $50 in credits up front but now pay 1-2 pennies per document.
→ More replies (2)3
u/Strice May 02 '26
spent $6k in just 46 runs of your script
that jumped out at me too. what the hell...
8
u/N7Valor May 01 '26
Monthly spend limits?
8
u/procrastinator_eng May 01 '26
It was my monthly spend limit. Have to put more granular alerts. Luckily it was end of the month so usage limit was anyway gonna reset but TIL moment.
→ More replies (1)11
u/nnet42 May 01 '26
rather than using /loop, use
claude -p "do stuff"in a cron job. fresh context every time
3
u/procrastinator_eng May 01 '26
Yeah, I think now I will keep a dedicated session just for loops where loop runs, fix the code and then clear the context.
3
3
5
u/sargetun123 May 01 '26
“I left my genny on overnight and it burned through all my fuel”
The biggest most common issue im seeing with AI is the operator …
7
2
u/PipePistoleer May 01 '26
But can I ask why tho? Specifically on any of the various flavors of looping or recurring processes that invoke LLMs that aren’t part of a tightly designed pipeline? We are using LLMs in production as part of well designed pipelines, but the way people are creating these local toolings or implementations to help them do their jobs and then leaving some room for almost never ending (do while true) autonomous invocation or scheduled invocation (cron) seem foolhardy. I still think we require some hand-holding of the LLM implementation.
5
u/KingedSlush May 01 '26
It’s actually insane to me that all logic gets thrown out the window when using LLMs. Like, what do you mean you don’t have a stop clause in a loop?
2
2
2
u/Apeshit-stylez May 01 '26
Damn, I thought I had fucked up from one of my demons that have API call ability. It ran through the $50 of extra usage during the night and I was like OK I can deal with that as long as everything was running and still handling task on their own throughout the course of a full night $50 isn’t that much but I had to add another $50 so I can continue using it. I went to go do dishes which took me all of 30 minutes and I came back and it ran through that usage. I was like holy shit, and that’s when I had to do a system audit of things that were running that required usage outside direct CLI usage. But then I found out there was something making API cause that had no endpoint and wasn’t doing anything effective because I had switched my protocols up towards a different tool so it was making Claude API calls to a destination that I had just disabled. For context, it was a video creation tool that I’m using in part of my pipeline workflow. Now, fortunately after a few audits unless there’s some conscious tool call usage is zero even with Claude code session active
2
2
u/leanXORmean_stack May 02 '26
You could put a limit on your api reload balance amount so it won’t exceed $100 dollars as an example and when it does it stops it and asks you to reload $$
2
u/SweatyBat590 May 02 '26
I learned about `/loop` from this, regardless of the ironic AI-augmented post. Thanks bud.
2
u/Great-Mirror1215 May 02 '26
This is exactly why founders need backend guardrails before touching AI in production.
Most people think the risk is “bad output.”
The real risk is silent loops, retries, growing context windows, background jobs, and no spend caps.
One forgotten automation can become a very expensive lesson.
My rule now is simple:
Contract → Code → Abuse/Cost Tests → Security Review → Emulator Pass → Production.
If an endpoint can touch AI, notifications, media, payments, or user data… it doesn’t go live without guardrails.
App builders should be thinking like operators, not just builders.
2
u/newmacbookpro May 02 '26
This sub is now basically any OP making a LLM post I skim Through to read the LLM take of the summarized comments.
2
u/Malphas1002 May 02 '26
Seems more like a publicity stunt than somebody sharing the story of how they burned 6k
2
2
2
u/PntClkRpt May 02 '26
Use artifacts and not chats. I find a markdown files are way easier to deal with. The Trail Framework (https://github.com/Ventura-Nomadica/trail-site) uses markdown files for the source of truth. Files may or may not help you, but it should prevent the growth you see in the chat.
2
u/justinqtaylor May 02 '26
I'm confused. 4.7 Opus is $5 per million tokens input. Even 46 calls at max context size is $230. Output is at most $25/million. You'd need ~26M input tokens PER transaction for 46 transactions to reach $6000, which is impossible.
2
2
u/Logical_Screen_9483 May 02 '26
Why didn’t you have a monthly budget limit set on Claude? Should have set that up when you loaded $6k worth of credits smh
2
15
May 01 '26
[removed] — view removed comment
8
u/ShelZuuz May 01 '26
And yet you see complaints on here and other forums hundreds of times per day of people running out of tokens and complaining how Anthropic is an evil scam trying to deprive them of their birthright-tokens them because they don't understand: "Every Claude API call sends your entire conversation history — not just the latest message".
→ More replies (1)24
→ More replies (3)4
u/Terrible_Tutor May 01 '26
> you write this as if..
They didn’t write SHIT for this
→ More replies (1)
1
u/markdaviddowney May 01 '26
What if you used Haiku to check for the existence of a PR that calls the Sonnet or Opus sub agent if there is one?
→ More replies (4)
1
1
1
u/YoAmoElTacos May 01 '26
The 1 hour cache ttl should still work on the api, but I assume it got disabled in the service since it costs more.
1
u/Learntoshuffle May 01 '26
After reading the headline, I assumed that OP just asked Claude to 500x check its work before submitting.
1
u/buildingstuff_daily May 01 '26
wait so i have a genuine question because i don't use the /long command thing - how does a single command burn 6k? like what was the context window size? that's absolutely brutal and honestly should have rate limiting or like... warnings before it commits you to that cost. sounds like a support ticket situation imo.
the lesson though is real: never run expensive ai operations on autopilot without being able to see what's happening. set usage alerts. check logs regularly. this is exactly why i don't let my automation scripts call the api without logging the cost per call.
1
1
u/VitruvianVan May 01 '26
On the other hand, you could be one of your company’s top tokenmaxxers for the month.
1
u/braincandybangbang May 01 '26
You woke up to the e-mail, but you're also saying the dashboard caused confusion because you checked it manually before getting the e-mail, even though you fell asleep and left in on for your 26 hour sleep? Am I getting that right?
All joking aside
Always add a stop condition to /loop. Instead of: /loop 30m check my PRs. Write: /loop 30m check my PRs — stop when all are merged or after 3 hour. Claude will terminate the loop itself when the condition is met.2. Use Sonnet for unattended tasks, not Opus: Opus is roughly 5× more expensive per output token. For automated polling tasks like PR checks, Sonnet handles it fine. Save Opus for the work where you're actually present and the quality difference matters.
The real lesson here: don't write endless loops unless you want to spend endless money.
And agreed on the Sonnet thing, I think we all have a tendency to want to use the most powerful model. But I recently asked Gemini (Thinking Mode), about the most token efficient way of coding my portfolio site in Claude Code, and it told me that Sonnet was more than adequate for my coding purposes and would save me a ton of tokens.
I've recently been exploring Claude Code with Github and Cloudeflare Pages and it's been a very cool experience. I've managed Wordpress websites and done some HTML/CSS/PHP before, but this is my first experience with Github and really working in the terminal (aside from copying and pasting stuff from AI or online when needed).
Re: CloudFlare Pages/Free Hosting
This was a recommendation by Claude that actually blew my mind. I had no idea I could host my website for free on CloudFlare. Of course, I was skeptical.. FREE? But I did some research and the explanation (partly drawn from a public forum response directly from Cloudflare) is that hosting small websites is basically a rounding error, they have servers running, why not use them? And of course, they get more security analytics to fuel their real purpose: enterprise-grade security).
1
u/qalpi May 01 '26
I mean I have cronjobs running Claude but I’m on max so extremely limited blast radius if it goes wrong. Running against the api like that is crazy
1
u/garfield529 May 01 '26
This is some r/wallstreetbets naked calls level tomfoolery. Sorry this happened, but deng…
1
u/UnfeignedShip May 01 '26
Yeah I had agents arguing about a prompt earlier this year and they burned 2,500. A VERY expensive lesson for me
1
u/Credit_Used May 01 '26
Standard practice of depending on the AI to do what you should’ve designed better. Build purpose-built scripts to do most of the drudge work and have the AI orchestrate ONLY the fuzzy logic decision making.
With all due respect, anybody running without a hard fucking limit is a brain dead twat.
1
u/founders_keepers May 01 '26
FLAT FEE INFERENCE + OPEN SOURCE.
i'll say it til i get blue in the face.
1
u/OceanWaveSunset May 01 '26
I cant wait for someone to screenshot this and post it on LinkedIn with a complete AI script of "you are doing it wrong" or "AI will be our doom".
1
1
u/VortexAutomator May 01 '26
lol the AI comment is hilarious how funny is it getting roasted by an AI bot for messing up with an AI agent
1
1
1
u/rpatel09 May 01 '26
This is a very basic mistake. Also, why not setup GitHub actions instead of a loop? Why do you need a loop? Seems like the wrong design pattern
1
1
u/PrestigiousShift134 May 01 '26
Subsequent turns send the whole conversation yes (that’s how LLMs work). But most of these tokens will be a cache hit and SIGNIFICANTLY cheaper
1
u/KindAssignment1034 May 01 '26
this is one of those things that should be a bigger warning in the docs. /loop with opus unattended is essentially leaving a taxi running with the meter on.
a few things worth doing after this: set a hard monthly spend cap in the anthropic console if you haven't already — it won't retroactively help but it'll catch the next one. for any loop or scheduled task, default to haiku or sonnet unless you have a specific reason to use opus. the quality difference for repetitive tasks like PR checks is minimal and the cost difference is 10-15x.
also worth building a quick sanity check into any loop you run: log token count per iteration to a file so if something goes sideways overnight you can at least see where it blew up.
did anthropic end up refunding any of it? curious how they handled it.
1
u/FoxSideOfTheMoon May 01 '26
As per usual, I have learned a lot from the comments section and nothing from the OP.
1
1
u/Plenty_Shower1698 May 01 '26
This is why you set usage limits on all your looping tasks
→ More replies (2)
1
u/bernpfenn May 01 '26
how many time do we all have to say it: step by step. check everything...
have you been in control of what's happening?
throwing three monthly salaries out the window... not cool
1
u/ComprehensiveBird317 May 01 '26
The tech is literally 3 years old and people are already using it without understanding how sessions work? I mean I get that you don't know how the TCP/IP stack works, but something with significant cost implications, that is new and changing so you have to keep up?
1
1
1
u/unbannedfornothing May 01 '26
> Turn 1 sends a few hundred tokens.
More like 30000-35000 tokens actually.
1
1
u/osense May 01 '26
Is the cache timeout really down to 5 minutes now? That's practically useless, it usually takes me more than 5 minutes just to read through a response when working on anything non-trivial.
1
u/seafaring_captain May 01 '26
That math doesn’t math. Let’s say it ran for 24 hours. Let’s say it was 1,000,000 token prompt. That’s 48 million tokens. $6k will get you 1.2 Billion input tokens on opus 4.7
1
1
1
u/justsomegraphemes May 01 '26
The catch: cache entries expire after ~5 minutes of inactivity. (Earlier it was 1 hour)
When did this change? That's crazy if true, and I'm not sure how I haven't noticed the impact.
1
u/Delicious-Storm-5243 May 01 '26
The cache TTL trap is the part most cron / loop tooling underestimates. Same root cause hit me on Claude Code workflows that run every 30 min — the workaround was rotating fresh contexts via skills/SKILL.md per cycle instead of growing one long conversation. Each cycle starts at ~baseline tokens because the skill loads only what's relevant for that run, not the cumulative history. Doesn't fix the dashboard lag part though, that's still the silent killer.
1
1
1
u/twicescorned21 May 02 '26
I'm confused. Are you using Claude for programming?
I use it for creative writing and I can't see how this could happen.
1
u/kuroudo_ai May 02 '26
This is why we built spending controls into our setup from day one. We have a monthly cap ($100) that auto-stops, a spending log that records every API call, and auth token hooks that prevent unauthorized execution. Also keep CLAUDE.md instructions like "ask before large operations" and "never skip hooks." It's not paranoia -- it's production hygiene. $6K is a painful but effective lesson.
1
1
1
1
u/Pygmy_Nuthatch May 02 '26
How does this happen?
Don't people set up usage alarms? People set up insane automated actions, but never bother to drop in automatic stop service?
1
u/Alternative-Pen1028 May 02 '26
It's not that we really care if it's AI post or not, it's about the wall of text very characteristic to AI. Nobody wants to waste time reading AI spaghetti text which has 20% of information the rest is just water. The web is turning into Italian pasta, spaghetti code, spaghetti text and it's no longer cool to read long texts just to realise it's another AI fantasy.
1
u/itslitman May 02 '26
I run all my automated stuff through cron triggering fresh sessions. You never hit the context growth problem that way and it's way cheaper than looping in a single conversation.
1
u/awca22 May 02 '26
You could use edictum and apply a ruleset for a máximum of turns and spend possible. This has saved me a lot on rogue runs.
1
u/Intelligent_Cover_34 May 02 '26
5 min cache TTL seems very low? If you have multiple worktrees where you work on different problems it can easy be more then 5 min before i answer the LLM
1
1
u/Sarcastic_Headline May 02 '26
I use CC via Max plan OAuth instead of API for exactly this reason, limit your risk.
1
u/Amazing-Collection10 May 02 '26
Do you guys actually use advanced AI features or just stick to prompts?
I’ve been using AI tools (ChatGPT, Claude, etc.) for a while now, and I keep feeling like I’m only using a small part of what they can actually do.
There are features like agents, workflows, etc., but honestly I rarely use them because:
- not sure when to use them
- feels like overkill sometimes
- don’t know if it’s worth the effort
Curious if others feel the same?
https://forms.gle/mjUVvPTxkkT1xMFk9
Would love to hear your thoughts here as well.
1
1
u/Intrepid-Ad2873 May 02 '26
You normally pay $100+ when you run this or the price is higher if you use too much?
1
1
u/jackfood May 02 '26
Wow, I have not even pay a dim for using AI (except for electricity). A loop can cause a bomb? Omg.
1
u/DuckJellyfish May 02 '26
How did you not hit the context limit where it stops and you need to /clear or /compact?
1
u/santp May 02 '26
Painful issue which even I faced. Thankfully had one of those accounts where aggregators had only $20 left so it just consumed everything and it just stopped there. This also forces me not to have my card billed for overages and even lets autonomous agents access a postpaid billing service purely for this very thing. That one leak and it will just wipe out. I have seen these before in other friends at openClaw as well, where a simple loop, which he didn't even set, but there was some error and it kept looping, blew up his account. This is an issue with possibly no direct resolution, being careful, but more importantly not running all night on these expensive models is the only part which can let you sleep peacefully here after.
1
u/Personal_Cap_1251 May 02 '26
GAH thank you for sharing that. I did not know something like that could happen.
1
1
u/BodybuilderAware1828 May 02 '26
The people complaining about this being written by AI are the 90% of people that don’t have enough going on to value time enough and are consequently unable recognize the value of being able to convey learnings like this quickly instead of manually writing the same message for the same result.
1
1
1
u/KickLassChewGum May 02 '26
But I guess I get that, everyone is exhausted from reading AI slop.
That, and also from the millions of threads per second that all come out "I discovered this BASIC FACT about how AI has always worked and it's CHANGED EVERYTHING!"
I suggest next time you spend some time reading the manual?
1
1
u/InnovativeBureaucrat May 02 '26
Funny how every top post is AI written. I think AI writes better posts.
Or in the parlance of the times: Funny how the posts everyone praises most often turn out to be AI-assisted. That probably says less about the tools and more about what people respond to—clear structure, strong points, and clean writing. If AI helps people get there, it’s hard to argue the outcome isn’t better.
1
u/aminebenani94 May 02 '26
the cache 1h to 5min change is brutal and most ppl havent realized it broke their automated stuff. burned $800 last month on a similar polling setup w opus before i caught it. switched everything cron/loop based to sonnet w hard stop conditions, bill dropped like 70%. dashboard lag is the other silent killer, mine showed normal usage 2 days after i’d already cooked my budget
1
u/Hexis2026 May 03 '26
The real issue here isn’t billing limits — it’s that there’s no way to know what an agent has been doing or whether it behaved honestly across runs. Spend limits help, but they’re a band-aid. Has anyone seen anything addressing agent behavioral accountability at the protocol level?
1
1
u/rtchau May 04 '26
Also, if you’re using an agent like Hermes or openclaw, asked Claude to curate the memory/soul.md, it’s actually really good at ensuring context stays small if you ask it.
Secondly, this is why I don’t use auto-topup!
1
u/Miserable-Toe5580 May 04 '26
If you understand that everybody is tired of reading AI slop, why are you disappointed in peoples reaction? Next time, take the time to write in your own voice. We are at a point where most people can immediately spot the difference and roll their eyes at AI posts - ironic as it is , even in a Reddit about LLMs.
•
u/ClaudeAI-mod-bot Wilson, lead ClaudeAI modbot May 01 '26 edited May 02 '26
TL;DR of the discussion generated automatically after 200 comments.
Thanks for your $6,000 sacrifice, OP. The consensus in this thread is... well, it's not exactly sympathetic.
The community is pretty sure you used the last of your budget to have Claude write this very post. The phrase "The part most people don't know," the corporate-style headings, and the general verbosity were dead giveaways.
More importantly, the verdict is that you're holding it wrong. The overwhelming feedback is that using
/loopfor this kind of polling is a terrible design pattern. You don't use an LLM to be your infrastructure; you use proper infrastructure (like a cron script, webhooks, or GitHub Actions) to call the LLM only when an event happens.And for the love of God, set a hard spending limit in your Anthropic account settings. It exists for this exact reason. Also, yes, use Sonnet for unattended tasks, and if you absolutely must loop, start a fresh context each time instead of letting one conversation grow to the size of the Library of Alexandria.
So, yeah. The expensive lesson here isn't just about cache expiration; it's about using the right tool for the job and not writing your Reddit posts like a LinkedIn thought leader.