I Burned $400 in a Week Using Claude Code (Here's the Math)

I Burned $400 in a Week Using Claude Code

Here's the math on what went wrong, and the three hacks that fixed it.

I got excited about Claude Code. Everyone was raving. "Ship features 10x faster." "AI that actually codes." "The future of development."

So I signed up for Claude Pro, installed the extension, and went to town.

One week later: $400 in API costs.

Not because Claude Code doesn't work. It's incredible. But because I didn't know the three cost hacks that drop sessions from $100 to $19.

Here's the setup, the math, and what I wish someone had told me on day one.


The Setup (5 Minutes)

This part is fast because every tutorial covers it:

1. Get Claude Pro ($20/month at claude.ai/upgrade)
The free tier doesn't include Claude Code. Don't waste time trying.

2. Download VS Code (free at code.visualstudio.com)
If you already use it, skip this.

3. Install the Claude Code extension
Search "Claude Code" in VS Code extensions. 6 million installs, verified checkmark. That's the one.

4. Type /login
Opens your browser. Click authorize. Done.

5. Start coding
Ask Claude to build something. Watch it work.

Five minutes, tops. Now here's where it gets expensive if you don't know what you're doing.


Hack #1: Turn On Caching (Saves 81%)

The mistake I made: I let Claude read my entire codebase fresh every single session.

Large codebase + Opus model = $50-100 per session. I did this 8 times in my first week.

I didn't know about prompt caching. When you enable it, Claude caches your codebase context. First read costs full price. Every subsequent read in that session? 90% cheaper.

Here's the pricing breakdown (Sonnet 4.5):

Token Type Cost per 1M Savings
Fresh input tokens $3.00 —
Cache write (first time) $3.75 +25%
Cache read (subsequent) $0.30 90% cheaper

Real example from my second week:

  • Large refactor session (50K token codebase context)
  • Without caching: $100
  • With caching: $19
  • Savings: 81%

How to enable it:

Caching is controlled via environment variables. Before launching VS Code, set:

# macOS/Linux
export ANTHROPIC_PROMPT_CACHING=true

# Windows (PowerShell)
$env:ANTHROPIC_PROMPT_CACHING="true"

# Or add to your shell config (~/.zshrc, ~/.bashrc)

Alternatively, set it in your VS Code settings under Extensions → Claude Code → Environment Variables.

That's it. I didn't know this existed for an entire week. Cost me $324 that I'll never get back.


Hack #2: Stop Using Opus for Everything

The mistake: Opus is the best model, so I used it for everything.

The reality: Most tasks don't need Opus. You're paying 60x more for output tokens you don't need.

Claude has three models. Here's when to use each:

Model When to Use Input / Output
Haiku Simple edits, syntax fixes, formatting $0.25 / $1.25
Sonnet Most development, refactoring, debugging $3 / $15
Opus Complex architecture, stuck on hard problems $15 / $75

(Prices per 1M tokens. Note: Output tokens cost 5x more than input for all models.)

My new rule: Start with Sonnet. If it struggles after 2-3 attempts, upgrade to Opus. If it's trivial (imports, spacing, renaming), downgrade to Haiku.

Real scenario from last week (100 tasks, payment integration feature):

  • 60 simple tasks (Haiku): 30K input / 12K output = $0.02
  • 30 medium tasks (Sonnet): 30K input / 15K output = $0.32
  • 10 complex tasks (Opus): 20K input / 8K output = $0.90
  • Total with ladder: $1.24

Same 100 tasks, all Opus: 200K input / 80K output = $9.00

Savings: 86%

How to switch models: Type /model in Claude Code, pick from the list.


Hack #3: Run Multiple Sessions in Parallel

The bottleneck: Waiting for Claude to finish one feature before starting the next.

The fix: Git worktrees. Run 4 Claude sessions simultaneously.

I didn't know this was possible. I'd start a feature, wait 30 minutes for Claude to finish, then start the next one. Serial workflow. Slow. Painful.

Git worktrees let you create multiple working directories from the same repo. Each gets its own branch, its own file state, its own Claude Code session.

Setup:

# From your main project
cd /path/to/project

# Create 3 parallel worktrees
git worktree add ../project-auth auth-feature
git worktree add ../project-payments payment-integration
git worktree add ../project-dashboard dashboard-redesign

# Open each in separate VS Code window
# Run separate Claude Code session in each

Real example from last Tuesday:

  • Session 1: Building auth system (OAuth + JWT)
  • Session 2: Implementing Stripe payments
  • Session 3: Refactoring dashboard UI
  • Session 4: Writing test suite

All running at the same time. Four features that would've taken 8 hours sequentially? Done in 2 hours.

Time saved: 6 hours
Cost impact: Same total tokens, 4x faster delivery

When you're done, merge and clean up:

git worktree remove ../project-auth

This one hack changed how I work. I'll never go back to serial development.


The Combined Impact (Here's the Math)

My first week (before I learned these hacks):

Approach All Opus, no caching, serial workflow
Features built 4 features over 8 hours
Total cost $400

My second week (with these hacks):

Approach Model ladder + caching + parallel worktrees
Features built 4 features in 2 hours
Total cost $76

You just saved $324 and 6 hours.


Bonus: What Most People Don't Know

1. Batch API (50% discount)

If you're using the API directly (not the extension), use the batch endpoint for non-urgent tasks. Same models, half price, processes overnight. Perfect for documentation generation or test writing.

2. Context window optimization

Don't dump your entire codebase. Reference specific files with @filename or select only the code ranges you need. Smaller context = lower cost.

3. Plan mode

Before Claude writes code, ask it to plan. Type /plan or "plan this out first." Prevents costly rewrites when the approach was wrong from the start.

4. Checkpoints

Claude Code tracks file edits. If it goes off track, rewind to a checkpoint instead of burning tokens on "undo that and try again."


What to Do Next

If you're just starting with Claude Code:

  1. Get the setup done (5 minutes)
  2. Enable caching with environment variable
  3. Start with Sonnet, not Opus

If you're already using it:

  1. Check if caching is enabled (run echo $ANTHROPIC_PROMPT_CACHING)
  2. Review your model usage - are you overpaying for Opus?
  3. Try worktrees for your next multi-feature sprint

If you want more of these:

I'm writing more breakdowns like this. Actual tactics, real numbers, no fluff. Reply and tell me what you want next:

  • Advanced prompt patterns for Claude Code?
  • Building custom skills and tools?
  • Enterprise deployment strategies?
  • CI/CD integration workflows?

Mike Oddoye
Enterprise AE @ CoachHub | Building @ OptiMAX
@mikemeansbizz

P.S. That $400 I burned in week one? All because I didn't enable caching. Don't make the same mistake. Set that environment variable today.