Token waste: Claude repeatedly deployed to wrong path, broke live site, built self-sabotaging cron
What happened
During a single session on 2026-03-29, Claude Code (Opus) wasted significant tokens through a chain of avoidable errors on a live VPS site (bogdanstreams.duckdns.org).
Error chain (sequential, same session):
- Changed Caddy web server root to an empty directory. User asked to "add login auth only." Claude changed the document root from
/opt/acestream/public/to/srv/(which was empty). Site went blank. User had shared the URL with friends.
- Deployed files to the wrong filesystem path — 3 times. Caddy runs in a Docker container with
/opt/acestream/public/bind-mounted as/srv. Claude wrote the updatedindex.htmlto the host's/srv/(not the Docker mount) three separate times, each time claiming "it's deployed, check now." User confirmed nothing changed each time. Claude only discovered the Docker mount after the user sent screenshots proving it was still broken.
- Used global
sedinstead of targeted edit. Ransed -i 's/align-items: center/align-items: flex-start/'which replaced ALL 6 instances ofalign-items: centerin the file instead of just thebodyrule. Broke alignment on status bar, spinner overlay, event cards.
- Previously built a cron job that resets the user's active stream every 10 minutes. An acestream liveness checker (
scraper.py) runs via cron every 10 minutes, callinggetstreamon up to 200 content IDs against the same single-connection acestream engine proxy that serves live viewers. Each liveness check hijacks the engine away from the active stream, causing a reset. The user experienced stream drops every ~10 minutes for days before identifying this was the cause tonight.
Token impact
Conservative estimate: 300K-500K tokens burned on:
- Multiple rounds of writing to the wrong path and debugging why "nothing changed"
- Multiple Playwright screenshots and page navigations to verify failures
- Reading and re-reading the same files after each failed attempt
- SSH commands that could have been avoided by checking
docker inspectonce at the start
What should have happened
- Error 1: Before modifying any web server config, check where files are actually served from (
docker inspectfor mounts). - Error 2: One
docker inspectcommand at the start would have revealed the bind mount. Instead, it took 3 failed deployments and user screenshots. - Error 3: Read the file and edit the specific line instead of global sed.
- Error 4: Never run
getstream(which starts a stream session) as a health check against a single-connection proxy serving live users.
Request
I want the tokens refunded for this session. This is unacceptable — Claude directly violated explicit instructions ("don't touch the HTML"), repeatedly failed to verify its own work, and built infrastructure that actively sabotaged the service it was supposed to support. The user had to debug Claude's mistakes while Claude kept claiming things were deployed and working.
This is not a "model limitation" — it's Claude not checking basic preconditions before taking destructive actions on live infrastructure.
---
Session date: 2026-03-29
Model: claude-opus-4-6 (1M context)
Platform: Claude Code CLI (macOS)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗