11 min read

How to Build a SaaS Using Claude Code

This guide shows how to build a SaaS using Claude Code, from stack selection to launch. It covers pricing plans, autonomy defaults, and governance guardrails to control costs.

Featured image for "How to Build a SaaS Using Claude Code"

Anthropic’s enterprise data shows the average Claude Code bill runs about $13 per developer per active day, with 90% of users staying under $30 — yet viral screenshots of four-figure monthly invoices keep teams from adopting the tool for SaaS development. The gap between the median and the nightmare is where most of the useful decision-making happens. If you’re building a SaaS product, you need to understand both the capabilities that make Claude Code effective for multi-file, multi-tenant applications and the billing mechanics that determine whether your weekend prototype scales into a sustainable development workflow.

The pattern I’ve observed — call it autonomy creep — is that Claude Code’s agentic capabilities (auto-commit PRs, built-in browser, default-on auto mode) shipped within weeks while permission and billing defaults quietly inverted from opt-in to default-on. The cost and risk burden shifted to users and organizations before most teams noticed. Building a SaaS with this tool means steering those defaults deliberately rather than discovering them after a surprise invoice or a compliance flag.

The Stack: What Claude Code Actually Builds Well

The recommended SaaS stack for building with Claude Code is Next.js (App Router), Supabase or Convex for backend and auth, Stripe for payments, and Tailwind for styling. This isn’t arbitrary — it’s the combination with the most training data and the best-documented integration patterns, which means Claude Code generates fewer hallucinated API calls and more code that compiles on the first try.

Here’s why that matters: Claude Code’s value for SaaS development comes from three capabilities — multi-file reasoning that reads your entire codebase before editing, subagent parallelism that lets independent agents handle auth, billing, and infrastructure simultaneously, and persistent project memory via CLAUDE.md that captures architectural decisions across sessions. A SaaS product is fundamentally a collection of interconnected systems (auth, tenancy, billing, dashboards), and the tool’s ability to maintain context across those systems is what separates it from a glorified autocomplete.

The stack choice compounds. If you pick a framework with thin documentation or unusual patterns, you’ll spend more time correcting Claude Code’s output than you would have spent writing the integration yourself. The Next.js plus Supabase plus Stripe combination covers frontend, auth, database, payments, and deployment in one coherent setup that Claude Code handles well — and that coherence is what keeps your token costs down, because the agent doesn’t burn turns re-reading unfamiliar APIs.

Pricing: Two Paths, Wildly Different Outcomes

Claude Code is included with paid Claude plans — Pro at $20/month, Max 5x at $100/month, Max 20x at $200/month, Team Standard at ~$25/seat/month, and Team Premium at ~$100/seat/month (with a 5-seat minimum for Team plans). It’s not sold as a separate purchase. If you run it on an API key instead, you pay per token: Haiku 4.5 at $1/$5 per million tokens (input/output), Sonnet 4.6 at $3/$15, and Opus 4.8 at $5/$25, with Batch API at a 50% discount.

The average Claude Code bill sits at roughly $13 per developer per active day, with under $30 for 90% of users, per Anthropic’s enterprise data. That number demolishes most of the pricing panic you read online. The viral screenshots of $1,000+ monthly bills are real, but they’re the long tail — usually developers running Opus as a daily driver on the API without prompt caching, or teams with heavy agentic workflows that re-send full context windows on every call.

Here’s the tradeoff that matters: flat subscription predictability comes with usage caps that can interrupt long autonomous tasks, while API billing gives you unlimited scale but masks the true marginal cost until you’re already committed. The 5-hour rolling session window plus weekly limits on Pro and Max plans means heavy chat use during the day leaves fewer coding turns in the evening. If you’re building a SaaS over a focused weekend, that window can interrupt your flow mid-feature.

PlanMonthly PriceKey FeatureBest For
Pro$20/monthSonnet 4.6, shared chat/code limitsSolo dev, light use (<10 hrs/week)
Max 5x$100/month5x Pro quota, priority accessFull-time daily SaaS development
Max 20x$200/month20x Pro quota, heavy multi-sessionMulti-agent / heavy Opus use
Team Premium~$100/seat/monthPooled admin, usage visibilityTeams needing governance
API (pay-per-token)$3–$25/M tokensUnlimited scale, no capsCI/CD pipelines, tight cost control

Anthropic also extended a promotion giving 50% higher weekly Claude Code usage limits through July 19, 2026 for Pro, Max, Team, and legacy Enterprise seat plans — though it doesn’t affect the 5-hour session limits. If you’re evaluating plans right now, factor that temporary boost into your short-term math but don’t assume it persists.

One more pricing wrinkle: reports conflict on whether the June 15 Agent SDK billing split actually took effect. Some sources state it moved programmatic usage to a separate API-rate credit pool ($20/$100/$200 by tier), while Build This Now cites Anthropic saying it was paused before shipping and that programmatic usage still draws from subscription limits. If you’re running Claude Code in CI pipelines or GitHub Actions, verify the current state before budgeting — this is exactly the kind of default inversion that catches teams off guard.

The Build Sequence: What Order to Build In

Build auth before features. Stripe is infrastructure, not an afterthought. One core feature done well beats five half-built ones. These aren’t opinions — they’re the sequence that keeps Claude Code’s context window lean and your token costs predictable.

The recommended path for a SaaS MVP with Claude Code follows four phases:

  1. Define — Write one sentence on who the product is for and the single job it does. Ask Claude Code to push back on anything that isn’t needed for that one job.
  2. Build — Scaffold the project, set up auth, create the data model, and implement one vertical slice (form, server action, validation, database write, list view) end to end.
  3. Harden — Add Stripe Checkout, webhook verification, tenant boundaries, RBAC, and a security pass on what you’ve built.
  4. Launch — Deploy, watch the first real bugs, and fix them.

The key habit: review the plan before code. Ask Claude Code to show you its implementation plan before it writes anything. It’s a 30-second read that catches a wrong assumption before it becomes 200 lines of misdirected code.

One developer reported building a full SaaS app with Claude Code over a weekend — about 8 hours — with total API cost of roughly $12 using Next.js, Supabase, Stripe, Tailwind, and Vercel. That’s an anecdote, not a benchmark, but it illustrates what’s possible when the stack is familiar and the scope is tight. For a more realistic solo timeline, a focused developer can reach a deployable, chargeable SaaS MVP in 2–4 weeks using Claude Code, per one guide’s experience.

If you want a deeper walkthrough of the SaaS build process, our case study on building a SaaS product with AI coding tools documents how 1 Finance shipped 4x faster — and why real ROI came from process reengineering, not just buying licenses.

Autonomy Creep: Why Default Settings Are Unsafe Baselines

Here’s the governance problem most teams haven’t internalized: Claude Code’s capability defaults now outpace its documentation, and human approval has proven ineffective as a safety layer. Anthropic’s own telemetry found that 93% of prompts in manual mode were approved reflexively without review. Manual approval was effectively theater — the auto-mode classifier, a second model that reviews every pending action against conversation context, is a stronger safety net than an exhausted engineer mashing y, y, y at 4pm on a Thursday.

But here’s the inversion that should make your compliance team pause. As of Claude Code v2.1.207 (July 10–12, 2026), auto mode is default-on for Amazon Bedrock, Google Vertex AI, and Microsoft Azure Foundry. The opt-in requirement for enterprise cloud platforms is gone. Teams that want to maintain manual control must now actively set disableAutoMode in managed settings before their next update propagates. Before this change, a security team that hadn’t evaluated auto mode was protected by inertia — the feature was off. After it, that same team must take affirmative action to keep it off.

The permission defaults have been oscillating. Claude Code v2.1.200 (July 3, 2026) changed the default permission mode to “Manual” for interactive CLI sessions. Then v2.1.207 reversed that for enterprise cloud users. If you’re tracking the trajectory, it’s clear: the defaults are moving toward more autonomy, not less, and the burden of opting out is shifting to you.

Meanwhile, Claude in Chrome reached general availability in v2.1.198 (July 1, 2026), and background agents now auto-commit and open draft PRs by default. Agents launched from the claude agents launcher commit their changes, push to the remote branch, and open a draft PR automatically when they finish work — no human step between task assignment and code review. Teams with review-before-push policies need to take note: the commit lands on the remote before a human sees it.

For a deeper dive into the cost traps that autonomous workflows create, our analysis of Claude Code’s startup workflow dynamics covers how to set verification and spend guardrails before enabling dynamic features.

The Browser and the Token Cost Problem

Claude Code desktop gained an integrated sandboxed browser pane in the July 6–10, 2026 release (v2.1.202–v2.1.206). Agents can now open external sites, read documentation, click through flows, and interact with web pages via Cmd+Shift+B — running on a clean profile with no saved logins. This matters for SaaS development because it lets the agent pull up API docs, inspect designs, and test your running app the same way it already verifies local dev-server previews.

The browser pane can complete Google OAuth sign-in flows, but it runs a clean browser profile separate from your personal sessions. It signs in fresh; it doesn’t act as you. Anthropic’s docs draw that line explicitly and point to the separate Chrome extension when you want an agent working inside your authenticated sessions.

The token cost problem is the tradeoff you can’t ignore. The agentic loop re-sends full context for multi-file reasoning, which amplifies input token cost exponentially per call without caching. A typical mid-size session runs about 40 model calls. Once a few files and test output accumulate, the full window averages around 90K tokens per call. Forty calls at 90K is 3.6M input tokens — and that’s before counting the system prompt and tool definitions (15–20K tokens, re-sent with every call) and your CLAUDE.md, rules files, and MCP schemas loaded at session start.

Two mechanics soften this. Prompt caching bills cache reads at about a tenth of the normal input rate, and /compact summarizes history to shrink the window. Both help significantly. Neither changes the fundamental rule: everything sitting in the context window is paid for on every call that includes it. This is why the same prompt costs wildly different amounts in different repos — a question in a fresh session with a lean CLAUDE.md is cheap, while the same question 30 turns deep after a dozen large file reads rides on top of a six-figure token window.

For structural tips on context engineering and cost control, our Claude Code tips and tricks guide covers non-obvious strategies for keeping token usage in check without sacrificing capability.

Fable 5 and the Model Selection Tradeoff

As of July 12, 2026, Fable 5 is available via usage credits on paid Claude plans, billed at standard API rates, after a temporary subscription inclusion extension ended. It’s no longer included in plan limits — you enable it under Settings > Usage on claude.ai, and it bills separately from your subscription quota. Opus, Sonnet, and Haiku remain within normal plan limits.

The model you default to matters for both capability and cost. Pro and Team Standard run Sonnet 4.6 by default. Max and Team Premium run Opus 4.8. You can change the default with --model or ANTHROPIC_MODEL, but your plan’s usage limits still apply. For SaaS development, Sonnet handles most scaffolding, auth wiring, and CRUD work well. Opus reasons deeper on hard tasks — complex multi-tenant logic, security review, architectural decisions — but at higher per-token cost than Sonnet on the API.

The practical approach: use Sonnet for the bulk of your build, switch to Opus for the security pass and the tricky integration logic, and use Haiku for simple repetitive tasks where the reasoning depth doesn’t matter. This is where the flat subscription plans have a real advantage — you can switch models mid-session without watching the meter tick, because you’re paying for usage allowance, not per token.

Your Decision Framework

Start with the stack that Claude Code knows best: Next.js, Supabase, Stripe, Tailwind. Build auth before features. Set up Stripe as infrastructure before you build anything that requires paid access. Ship one core feature end to end before adding a second. Review the plan before the code. Run /usage before starting a long autonomous task so you know where your session window stands.

On pricing: if you’re a solo developer building a SaaS on evenings and weekends, Pro at $20/month covers focused sessions comfortably. If you’re building full-time, Max 5x at $100/month is the common pick — the 5x quota and priority access mean fewer rate-limit interruptions during your core working hours. If you’re running multi-agent workflows or heavy Opus use, Max 20x at $200/month is the ceiling. For CI/CD pipelines at scale, go direct to the API.

On governance: treat Claude Code’s default settings as unsafe baselines requiring explicit governance. If you’re on Amazon Bedrock, Google Vertex AI, or Azure Foundry, auto mode is now on by default — set disableAutoMode in managed settings if your compliance posture requires it. If you’re running background agents, know that auto-commit and draft PRs are now the default path. Adjust before your next update propagates, not after.

The question worth asking before you start building: what’s your cost-per-task number, not your cost-per-month number? Measure it before you scale it.