← Back to Stories

Claude Cut My S3 Bill in Half. It Took 20 Minutes.

Claude Cut My S3 Bill in Half. It Took 20 Minutes.
A few storage rules did most of the work

The top line of our AWS bill told us storage could cost less. What we didn't know was how to get there without risking anything our customers rely on.

So we gave Claude Code access to the AWS command line and asked: what are we paying for, and what can we change without disrupting service? It pulled the cost breakdown, measured each storage bucket, compared the storage options against how our application reads files, and came back with a plan. It took about 20 minutes, and nothing changed until we approved it.

Together the changes should cut our S3 bill roughly in half. The cleanup and backup changes took effect within days. The tiering savings build over one to three months.

We're writing this up because it took far less effort than we expected. Most teams have a cost or cleanup task like this one that keeps getting put off, and it may be a good one to hand to an AI.

What we changed

1. Clear out hidden copies

  • The issue: With versioning on, deleting or replacing a file keeps the old copy as a hidden previous version, billed indefinitely. Uploads that fail partway also leave billed pieces behind that never appear in a normal file listing.
  • The fix: We added a lifecycle configuration, a set of rules S3 applies automatically. Ours deletes old versions 30 days after they are replaced or deleted and clears abandoned uploads after seven days.
  • The trade-off: A deleted or overwritten file can now be recovered for only 30 days.

2. Move rarely used files to cheaper storage

  • The issue: Most stored files are rarely opened but billed at the standard rate. Glacier's archive tiers cost less but can take hours to restore a file. Glacier Instant Retrieval is fast but charges for each retrieval.
  • The fix: S3 Intelligent-Tiering moves files nobody has accessed in 30 days to a cheaper tier, and again at 90 days. Files come back in milliseconds when opened, with no retrieval fee, so links and applications keep working unchanged. We left its optional archive tiers, which need restores, turned off.
  • The trade-off: Each file carries a small monthly monitoring fee. Files under 128 KB skip the fee but never move to a cheaper tier.

3. Back up on the schedule you need

  • The issue: Our database backups, stored in S3, ran every 30 minutes, more often than we needed, and were kept for 30 days.
  • The fix: We now run them every two hours and keep them just as long, which cut backup storage by about three quarters.
  • The trade-off: A failure could now lose up to two hours of recent data instead of 30 minutes. Set the schedule by how much the business can afford to lose.