◉CLAUDE LABJP
●CC 2.1.332 — No new Claude Code release over the weekend. 2.1.332 (11/25) is still current●ANALYTICS — A fix to search counts in the Enterprise Analytics API may raise numbers from 11/17 onward●SONNET 4.5 — Today, 11/30, is Sonnet 4.5's last day on the Claude API. Move to claude-sonnet-5-5●USAGE — Some users report weekly usage jumping right after upgrading to a higher plan●NEW — New: Does what a Project remembers carry over into your everyday chats?●BILLING — More readers are looking for what to check when a payment won't go through●CC 2.1.332 — No new Claude Code release over the weekend. 2.1.332 (11/25) is still current●ANALYTICS — A fix to search counts in the Enterprise Analytics API may raise numbers from 11/17 onward●SONNET 4.5 — Today, 11/30, is Sonnet 4.5's last day on the Claude API. Move to claude-sonnet-5-5●USAGE — Some users report weekly usage jumping right after upgrading to a higher plan●NEW — New: Does what a Project remembers carry over into your everyday chats?●BILLING — More readers are looking for what to check when a payment won't go through
Articles/Claude Code
⟐ Claude Code/2026-05-06Advanced

90 Days Building a Solo SaaS with Claude Code — And the Three Things I Got Wrong

A working log from 90 days of building a solo SaaS with Claude Code — design conversations, model routing, and Cloudflare Workers constraints. Revisited months later against primary docs, with the wrong claims corrected in place, plus a D1-based Stripe webhook dedupe and a symptom-first troubleshooting table.

claude-code135saasindie-dev14monetization21next.jsstripe7

Build a SaaS solo, and make more from it than you spend on Claude Code. That was the entire goal. I kept a running log for 90 days starting in February 2026, and this article is that log made public.

This isn't a success story polished for social media. It includes the wrong turns, the bad calls, and the tokens I burned for nothing — because those parts are where you'll find the most useful signal.

There's one more thing. Months after publishing, I went back through every technical claim here and checked it against the Cloudflare and Claude Code docs. Three of them were wrong. Not the docs — me. I've left the original claims in place rather than quietly editing them, with a correction next to each one. A wrong belief you can see being corrected is more useful than a clean paragraph that never shows its work.

1. Why Claude Code?

"Why not Cursor?" is the first thing people ask. I asked it too, for a while.

What changed my mind was a bug fix session. Claude Code traced the impact across multiple files, rewrote the tests, and staged a commit — autonomously, without me orchestrating each step. Cursor excels at in-editor completion, but Claude Code thinks through work. For SaaS development where dependencies get tangled fast, that difference is meaningful.

The other reason was how visible the cost was. Claude Code works on Pro and Max subscriptions too, but for these 90 days I connected it to an API key from the Console and paid per token. The original version of this article said "Claude Code runs on API usage billing" as if that were the product's only mode. It was only my setup. As of November 2026, the official Manage costs effectively page says the cost figure in the Session block of /usage is meant for API users, and that for subscribers it isn't what you're billed. Flat-rate plans can blur that feedback loop, and I wanted to feel every token while I built. As an indie developer, cost awareness is directly tied to profit margin.

2. Choosing the Product (Day 1–7)

The first week went entirely to product selection. I used three filters.

① Something I'd use every day
The most reliable demand signal is whether you personally need it. I picked a unified dashboard for managing sales, reviews, and rankings across multiple App Store products.

② A stack where Claude Code excels
Next.js + TypeScript + Stripe + Cloudflare Workers. I chose this because Claude Code is deeply familiar with it — error self-correction rates are high, and generated code rarely needs major rework. If I'd gone with Ruby on Rails or Django, the learning cost and debugging overhead would have compounded.

③ Monetizable complexity within three months
I designed for "small start, charge early." The plan wasn't to finish and then add billing — it was to ship the first paid feature on Day 30 and work backward from there.

3. MVP Design — A Week of Architecture Conversations (Day 8–14)

Before writing a line of code, I spent a week working through the design with Claude Code, leaning heavily on plan mode.

# Example from the design phase
claude --model claude-opus-4-6 "
Review this architecture for Next.js + Cloudflare Workers.
 
Requirements:
- Fetch data from App Store Connect API
- Unified dashboard for sales and reviews across multiple apps
- Stripe Pro monthly subscription ($5/month)
- Must scale to 10,000 users
 
Known constraints:
- App Store Connect API has rate limits
- Cloudflare Workers CPU time budget (10 ms per request on the Free plan)
"

Two architectural pitfalls surfaced from that conversation.

Correction 1 (2026-08-31)
That prompt above carries a claim I repeated for months: "Cloudflare Workers CPU limit is 10ms per request." That figure only describes the Free plan.

CPU timeWorkers FreeWorkers Paid
Per HTTP request10 ms30 seconds by default, raisable to 5 minutes
Per Cron Trigger10 ms30 seconds (interval under 1 hour) / 15 minutes (1 hour or more)

The part that actually mattered, and that I had backwards: time spent waiting on fetch(), KV reads, or database queries does not count toward CPU time (Limits). So my worry — "we call several external APIs per request, we'll blow the CPU budget" — was aimed at the wrong thing. What burns CPU is walking the JSON you got back and aggregating it in JavaScript.

Raising the ceiling on the Paid plan is a single config block:

{
  "limits": {
    "cpu_ms": 300000 // default is 30000 (30 seconds)
  }
}

Was the Cron + KV offload wasted, then? No. Ten milliseconds is genuinely tight — Cloudflare's own guidance notes that workloads doing auth, server-side rendering, or large payload parsing typically land in the 10–20 ms range. Precomputing the aggregation was the right call. I just held the right conclusion for the wrong reason, which is a fragile place to be.

Pitfall 1: Cloudflare Workers CPU limits
Aggregating App Store Connect data inside the Worker would exceed the CPU budget. Claude Code's recommendation: offload aggregation to a Cron Trigger and write results to KV. Making that call on Day 8 prevented a painful refactor later.

Pitfall 2: Stripe Webhook idempotency
A naive "charge complete → set KV flag" design breaks under Webhook retries. Claude Code flagged this before I'd even thought about it. Building idempotency keys into the design from the start avoided a class of bugs I've been burned by before.

The smallest setup that actually stops duplicates

In the first version I wrote "I built in idempotency keys" and left it there. Reading it back, the useful part was missing: what the key is, and where it gets recorded. So here is how I would write it today, for the same stack.

Stripe's own guide (Receive Stripe events in your webhook endpoint, checked November 2026) asks for three things:

  • Verify the signature against the raw, untouched request body
  • Return a 2xx quickly, before any heavy work
  • Detect duplicates by event ID, not by created

In live mode, Stripe keeps retrying for up to three days with exponential backoff. That means the same event can show up hours later, or two copies can land almost at once. The design has to assume both.

First, a D1 table for events you've already handled:

-- migrations/0001_processed_events.sql
CREATE TABLE IF NOT EXISTS processed_events (
  event_id    TEXT PRIMARY KEY,
  type        TEXT NOT NULL,
  received_at TEXT NOT NULL DEFAULT (datetime('now'))
);

Then the Worker. On Workers, stripe-node needs to be told to use fetch as its HTTP client and Web Crypto for signature checks.

// src/stripe-webhook.ts (Cloudflare Workers + stripe-node + D1)
import Stripe from "stripe";
 
export interface Env {
  STRIPE_SECRET_KEY: string;
  STRIPE_WEBHOOK_SECRET: string; // whsec_..., specific to this endpoint
  DB: D1Database;
}
 
const cryptoProvider = Stripe.createSubtleCryptoProvider();
 
export default {
  async fetch(request: Request, env: Env): Promise<Response> {
    if (request.method !== "POST") return new Response("method not allowed", { status: 405 });
    const signature = request.headers.get("stripe-signature");
    if (!signature) return new Response("missing signature", { status: 400 });
 
    const stripe = new Stripe(env.STRIPE_SECRET_KEY, {
      httpClient: Stripe.createFetchHttpClient(),
    });
 
    // Verify against the raw body (calling request.json() first breaks the signature)
    const body = await request.text();
    let event: Stripe.Event;
    try {
      event = await stripe.webhooks.constructEventAsync(
        body,
        signature,
        env.STRIPE_WEBHOOK_SECRET,
        undefined,
        cryptoProvider,
      );
    } catch (err) {
      return new Response(`signature error: ${(err as Error).message}`, { status: 400 });
    }
 
    // Use event.id as the primary key; only the first delivery gets through
    const claim = await env.DB
      .prepare("INSERT INTO processed_events (event_id, type) VALUES (?, ?) ON CONFLICT(event_id) DO NOTHING")
      .bind(event.id, event.type)
      .run();
    if (claim.meta.changes === 0) {
      return new Response("duplicate", { status: 200 }); // already handled; 2xx stops the retries
    }
 
    try {
      await handleEvent(event, env);
    } catch (err) {
      // If handling fails, release the claim and return 500 so Stripe retries
      await env.DB.prepare("DELETE FROM processed_events WHERE event_id = ?").bind(event.id).run();
      return new Response("retry later", { status: 500 });
    }
    return new Response("ok", { status: 200 });
  },
};
 
async function handleEvent(event: Stripe.Event, env: Env): Promise<void> {
  switch (event.type) {
    case "checkout.session.completed": {
      const session = event.data.object as Stripe.Checkout.Session;
      await env.DB.prepare("UPDATE users SET plan = 'pro', stripe_customer_id = ? WHERE id = ?")
        .bind(session.customer as string, session.client_reference_id)
        .run();
      break;
    }
    case "customer.subscription.deleted": {
      const sub = event.data.object as Stripe.Subscription;
      await env.DB.prepare("UPDATE users SET plan = 'free' WHERE stripe_customer_id = ?")
        .bind(sub.customer as string)
        .run();
      break;
    }
    default:
      break; // ignore events we don't subscribe to
  }
}

Three choices in there deserve a sentence each.

Why D1 and not KV for the duplicate check. KV is eventually consistent: a write can take 60 seconds or more to be visible from other locations, and it has no atomic operations (How KV works). If two copies of an event arrive together, both can read "not processed yet." With INSERT ... ON CONFLICT DO NOTHING, exactly one of them sees meta.changes === 1.

Why the claim is released on failure. If the record stays but the handler crashed, that event is never processed again. This version keeps the handler light — a D1 update or two — so it runs inside the request. If you add anything slow, like sending email or calling another API, push that work to a queue and return the 2xx first, which is what Stripe recommends.

Why the updates themselves are idempotent. Setting plan = 'pro' twice changes nothing. Something like "increment usage by one" would double-count. I'd rather have the key and idempotent writes, so that the day the DELETE itself fails isn't the day I lose sleep.

This code is my old implementation rewritten against the stripe-node and D1 docs as of November 2026. I didn't redeploy it to production for this article, so please run a test event through it — stripe trigger checkout.session.completed works — and confirm the second delivery comes back as duplicate.

Three common misreadings

BeliefWhat the docs say (Stripe / Cloudflare, November 2026)
If I manually resend from the Dashboard and get a 2xx, automatic retries stopA manual resend does not cancel automatic retries. Expect the same event to arrive again
created tells me order and whether I've seen an eventcreated is in seconds and distinct events can share it. Use the event ID for duplicates
A "processed" flag in KV prevents duplicatesKV is eventually consistent with no atomic operations. Use a D1 unique constraint or a Durable Object

4. Implementation — Model Switching and Token Discipline (Day 15–60)

This is the phase with the most direct impact on cost. Here's the decision framework I settled on.

Model assignment by task type

TaskModelReason
Architecture / design decisionsclaude-opus-4-6Requires complex reasoning
Feature implementationclaude-sonnet-4-6Best cost-to-quality ratio
Simple refactorsclaude-haiku-4-5Fast, cheap
Bug fixes with known root causeclaude-haiku-4-5Direction already set

The IDs above — claude-opus-4-6, claude-sonnet-4-6, claude-haiku-4-5 — are what I actually ran during those 90 days. They're still valid IDs, though Opus 5 and Sonnet 5 have since shipped. The generation moved; the shape of the routing didn't. Reasoning to the top tier, drafting to the middle, mechanical edits to the bottom. Substitute the current names and the table still holds.

In practice, I used Opus only for the morning design session. Everything else went to Sonnet and Haiku. My invoice dropped noticeably starting that month. I originally wrote "roughly 40%" here, and I've cut that number: I changed two things at once — model routing and shorter sessions — and never isolated them. One of the two may have done nothing.

Session discipline

The most common Claude Code mistake I see — and made myself — is letting sessions run too long. When context bloats:

  • The model starts proposing implementations that contradict earlier decisions
  • Correction loops multiply, burning tokens
  • It loses the thread of what changed and why

My fix was CLAUDE.md as a state ledger. At the end of each session, I wrote down what was decided. At the start of the next session, I loaded it in first.

<!-- CLAUDE.md state section example -->
## Current Implementation State (2026-03-15)
 
### Completed
- App Store Connect API wrapper (src/lib/asc.ts)
- Cloudflare KV caching strategy (5-minute TTL)
- Stripe Webhook idempotency key implementation
 
### Next session tasks
- Build dashboard UI components
- Add recharts for data visualization
- [ ] NOTE: keep charts (recharts) inside 'use client' components

The warning notes are the most important part. Claude Code doesn't remember the last session, but the document does.

The original note read "recharts does not work in Cloudflare Workers." Rereading it, I realized I had never checked why I believed that. A warning in the ledger needs its reason and a link, or it becomes folklore. That's the line I hold now, so the example above keeps only the rule I follow and drops the explanation I couldn't back up.

5. First Paying Customer (Day 30)

The first paid feature shipped on schedule. One design decision is worth sharing.

Reducing friction from free to paid

Claude Code's initial proposal for the onboarding flow asked for payment info immediately after signup. I pushed back and rewired it:

Sign up → 7-day full access trial → Day 8: paid features gated → Stripe Checkout

My reasoning was personal: services that ask for a card before I've seen any value lose me immediately. Let users experience the product first.

I'd like to report what happened to conversion. I can't, honestly. At Day 30 the denominator was under a hundred sessions, and "12% to 27%" at that sample size is a wish wearing a percentage sign. It was in the original draft; I've removed it. If you want to measure this properly, wait for a few hundred sessions per arm before you believe the delta.

The Stripe implementation was a one-line config change. The harder part was designing the email sequence — when to remind users the trial is ending, how to frame the ask — and that's where my back-and-forth with Claude Code was most iterative.

If you use Stripe's own trial (subscription_data.trial_period_days in Checkout), anchor the reminder on Stripe's event rather than your own timer. customer.subscription.trial_will_end is sent three days before the trial ends, or right away if the trial is shorter than three days (Using webhooks with subscriptions, November 2026). On a 7-day trial it arrives on day four, which is a good moment to check that a payment method exists and tell the customer when billing starts.

const session = await stripe.checkout.sessions.create({
  mode: "subscription",
  line_items: [{ price: env.PRO_PRICE_ID, quantity: 1 }],
  subscription_data: { trial_period_days: 7 }, // the trial is this one line
  client_reference_id: userId, // lets the webhook find the user
  success_url: "https://example.com/billing/success",
  cancel_url: "https://example.com/billing",
});

Adding case "customer.subscription.trial_will_end": to the webhook handler does nothing if the endpoint isn't subscribed to that event. I now review the code and the Dashboard endpoint settings as a pair, every time.

6. Production on Cloudflare (Day 60–90)

Three errors in production required Claude Code's help to diagnose. All were Cloudflare Workers-specific.

Error 1: Cannot perform I/O on behalf of a different request

claude "Analyze this stack trace from a Cloudflare Workers environment.
[paste stack trace]
 
I believe this is triggered when a KV operation is called from 
a context that has already resolved. What's the fix?"

The answer came back instantly, and I recorded it as: root cause was a KV write without waitUntil(). Fix: five lines.

Correction 2 (2026-08-31)
That's the wrong root cause. This error fires when an I/O object created in one request's context — a response body, a stream, an in-flight binding operation — is touched from a different request's handler. The usual way to cause it is stashing request-scoped state in a module-level variable. Isolates are reused across requests, so the next request reaches for the previous request's belongings and the runtime stops it. The fix is to keep per-request values out of global scope entirely and pass them through arguments or env bindings (Workers Best Practices).

waitUntil() solves a different problem: continuing work after the response has been sent. It extends execution for up to 30 seconds past the response or the client disconnect. My code had both defects at once, and adding waitUntil() made the symptom disappear — which I mistook for having found the cause. Those are not the same thing, and the difference cost me a rewrite months later.

Error 2: deploys started failing on Worker bundle size

This one came from the content-serving Worker I was maintaining alongside the dashboard, not from the dashboard itself. Content lived in one large JSON file bundled into the Worker, and past a certain record count the deploy stopped going through.

Claude Code proposed separating metadata from HTML content, writing the content out as individual static asset files and fetching them at runtime through the ASSETS binding. Having the reasoning explained alongside the generated code made a structural change feel manageable.

Correction 3 (2026-08-31, revised 2026-11)
I titled this "62 MiB Worker bundle limit" and called it a "traversal limit." Neither is right. There is no 62 MiB limit and no such thing as a traversal limit — the 62 was a half-remembered 64, the uncompressed ceiling. In August I added that "the number that actually stops your deploy is the compressed one: 3 MB on Free, 10 MB on Paid." As of November 2026, the Limits page no longer has a compressed limit at all. Only the uncompressed size counts. So this correction needed its own correction.

Worker size (November 2026)Workers FreeWorkers Paid
Uncompressed64 MiB64 MiB
After gzipNo limit (shown for reference)No limit (shown for reference)

You can check yours without deploying:

wrangler deploy --outdir bundled/ --dry-run
# Total Upload: 259.61 KiB / gzip: 47.23 KiB

Read Total Upload — that's the uncompressed size. The gzip: figure is informational. Cloudflare also notes that large bundles slow startup even below the ceiling, so moving config files, static data, and binary blobs into KV, R2, D1, or static assets is still worth doing early.

Symptom-first troubleshooting for this stack

Here's what I hit in production, plus what I found while re-reading the docs for the corrections above, arranged so you can look things up by symptom. Error strings are copied from the official docs.

SymptomLikely causeHow to checkFix
Worker exceeded resource limits (Error 1102)CPU time exceeded by in-request aggregation (10 ms on Free), or memory exceededDashboard → Metrics → Errors → Invocation Statuses: Exceeded CPU Time Limits vs. Exceeded MemoryMove aggregation to a Cron Trigger and only read results. On Paid, raise limits.cpu_ms
Cannot perform I/O on behalf of a different requestRequest-scoped objects held in module-level variablesList every let/const outside your handlersPass per-request values through arguments or env
No signatures found matching the expected signature for payloadBody parsed as JSON before verification, or a whsec_ from a different endpoint (test, live, or CLI forwarding)Is anything touching the body before request.text()? Does the secret belong to this endpoint?Pass the raw body to constructEventAsync; use the per-endpoint secret
The same payment is processed twiceLive-mode retries (up to three days) or a KV-based check missing a raceIn the Dashboard's event deliveries, count deliveries per event IDMake the event ID a D1 primary key and let only the first through
Deploy rejected for sizeUncompressed bundle over 64 MiBTotal Upload from wrangler deploy --dry-runMove content and static data to static assets or R2 and fetch at runtime
Trial-ending emails never go outEndpoint not subscribed to customer.subscription.trial_will_endThe endpoint's subscribed-events listSubscribe to the event and add the branch in handleEvent

To be clear about provenance: the first two rows are ones I actually hit. The other four I added ahead of time from the docs while rewriting this piece.

90-day cost and revenue snapshot

ItemAmount
Claude Code token cost (90 days)~$300
Cloudflare Workers (free plan)$0
Stripe feesVariable, scales with revenue
MRR at Day 90Not disclosed

Token cost was heaviest in month one — about $130 — before I tightened the model-switching rules and CLAUDE.md discipline. Months two and three averaged around $85 each. Those are invoice figures, not estimates. What I can't tell you is which change did the work, because I made both in the same week. If you want the answer, introduce one at a time and read the invoice a month later. I didn't, and now I can only report the total.

I keep MRR private not to be coy, but because a number from a project this size sets an expectation that doesn't transfer. Different product, different audience, different order of magnitude.

7. What the 90 Days Actually Taught Me

What worked

Spending real time on design. The two-week architecture phase with Claude Code meant the implementation phase had almost no major course corrections. I never had to tear out a foundational decision.

Documenting failures in CLAUDE.md. Writing down what went wrong between sessions meant I didn't repeat mistakes. Claude Code doesn't have memory across sessions — but the project document does.

What I'd do differently

Less perfectionism on UI. The first paying customers cared about whether the tool solved their problem, not whether the dashboard looked polished. I burned probably ten days on UI detail that didn't move conversion.

Shorter sessions. I once ran an eight-hour session that ended with Claude Code generating code that contradicted designs it had made four hours earlier. I rolled everything back. Now I break at two hours and update CLAUDE.md before stopping.

8. Where you'll likely get stuck after the first payment

Once the first paying user shows up, these are the four places the same stack tends to stall next.

Cancellations and plan changes. If you only listen for checkout.session.completed, cancellations and downgrades never reach your app. Add customer.subscription.updated and customer.subscription.deleted to the handler above and map the subscription's status back to a plan.

Rethinking how you pay for Claude Code. Once development settles, you'll wonder whether to stay on per-token billing or move to a subscription. I laid out the trade-offs in the Claude plan cheat sheet for indie developers.

Session handoff. Even with a CLAUDE.md ledger, stepping away can leave you with a compacted summary that dropped the details you needed. How to spot that and keep what matters is in spotting idle compaction.

A growing bundle. Whether the "content as static assets" layout keeps holding as content grows is best answered by counting real bytes. I did that in recounting the bytes outside my Worker bundle.

If you add features that call the Claude API from inside the app, the model routing design patterns piece may be a useful starting point.


Ninety days was enough to answer "can I build this at all." Getting to revenue wasn't Claude Code alone — years of shipping small products taught me when to stop polishing. I originally claimed it made me three to five times faster. I've cut that too. I never measured it, and a multiplier I can't reproduce isn't worth the credibility it borrows. What I'm sure of is narrower: deciding what to build, and when to stop, stayed my job the whole time.

Rewriting this piece taught me something the original 90 days didn't: the answers that arrive instantly are the ones most worth checking against a primary source. All three corrections above trace back not to Claude Code being wrong, but to me compressing its answer into a shorter, more confident sentence than the evidence supported. A symptom disappearing is not the same as a cause being understood.

If you want to try this yourself, start with a 30-day challenge: get one person to pay you for something before the month ends. That constraint sorts your priorities for you. And when you write it up, put the doc URL next to every technical assertion while you still remember why you believed it. Your future self will thank you. Mine spent half a day reconstructing three of them.

Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

⟐ Claude Code2026-05-27
11 Days in Crashlytics: A Claude Code Debug Loop Across Two Android Wallpaper Apps
After shipping Beautiful Wallpapers v2.0.0 and Ukiyo-e Wallpapers v1.7.0 in early May, Crashlytics and Play Console threw more than 30 new issues at me in 11 days. This is the operations log of how I drove the fix list down to v2.1.1 / v1.8.1 using Claude Code as a triage partner.
⬡ API & SDK2026-04-28
Building a Recurring Billing SaaS with Claude API and Stripe — From Architecture to Production
A complete architecture guide for building a SaaS product powered by Claude API with Stripe recurring billing. Covers usage metering, tiered pricing, webhook handling, and production deployment patterns.
⟐ Claude Code2026-11-10
How Far Behind Is Your Claude Code on the stable Channel? I Counted Published Versions Instead of Subtracting Numbers
Subtracting version numbers overstates the gap between stable and latest. Here is a short Python script that counts published versions from the npm registry, plus the channel settings worth knowing.