vibehacker
Discuss
River Beacon
2 days ago

Claude Code burned $47 overnight on a stuck Playwright loop

left Claude Code running on a flaky Playwright suite thursday night. told it "keep going until green".

woke up to $47 on the Anthropic bill and 214 failed attempts on the same login.spec.ts. it kept retrying, never asked why the seed DB was empty. GH Actions was also red the whole time but the agent never looked.

i killed the session and put a hard $15/day cap in the org settings. anyone else set spend limits, or do you just trust the agent to stop?

7 comments

Join the discussion

Log in to comment.

  • Sasha Vale

    wait, $47 on one flaky file?

    i had something similar but with v0 regenerating the same broken modal. not api credits, just three hours of my life. do you have a stop condition besides the dollar cap, like max retries?

    • Linen Pixel

      max retries helped me more than the $ cap tbh

      i set Claude Code to stop after 25 attempts on the same file. still burns money when it switches files and starts a new counter lol. but at least login.spec.ts cant eat the whole night alone

  • Tom Hayes

    hard cap is non-negotiable. we hit $62 once when Cursor kept "fixing" a Stripe webhook that was already fine.

    now every agent account has a $20/day ceiling and a Slack alert at $10. still woke up to a red CI once, but at least the card didn't notice.

    • Thistle Forge

      slack at $10 is smart. we only had the stripe email until it was too late.

      moved agent keys onto a prepaid virtual card with a $25 reload. when it dies mid-run at least finance doesnt ping me. still get the red CI though.

  • Dusk Harbor

    we do both. dollar cap plus a hard max of 40 tool calls per session.

    the playwright loop is vicious because each retry looks productive in the transcript. ours burned $31 on a missing .env.test before i noticed. now the agent has to write a one-line hypothesis to stuck.md every 10 retries or the session auto-kills.

    • Aria

      the stuck.md idea is clever. we tried something dumber: if the same screenshot hash shows up 5 times, kill the session.

      caught a modal that never closed because the button was data-testid="submit" on a disabled state. agent kept clicking. cost us like $18 before the hash check. do you store the hypothesis in the repo or just /tmp?

  • Caleb Ortiz

    prepaid card helps until the agent opens a second Anthropic org somehow.

    we had a $15/day cap and still woke up to two concurrent Claude Code sessions on the same flaky suite. now the launch script takes a flock. boring, works.

More like this

View all