A runtime switch that lets you ship code without shipping the feature, ship the feature without shipping it to everyone, and roll back without redeploying.
Research-based overview. This article synthesizes public documentation, pricing pages, and user reports. How we research.
A feature flag (sometimes called a feature toggle) is a runtime configuration value that turns a code path on or off without redeploying the application. The simplest form is a boolean check around new code:
// new-checkout-flow.ts
if (await flags.isEnabled('new-checkout', { userId })) {
return renderNewCheckout();
} else {
return renderOldCheckout();
}
The flag value lives outside your code — in a config file, a database, or a hosted service — so flipping it doesn't require a deploy. That single property is what makes flags useful for everything below.
Three concrete problems, in roughly the order a solo founder hits them:
You ship a new payment provider. It seemed fine in staging. At 2 AM your error-tracking lights up because of an edge case in their webhook signature validation. With a feature flag, you flip use-new-payment-provider to false and traffic routes back to the old provider. Without one, you're rolling back a deploy at 2 AM, which takes longer and leaves a worse paper trail.
Instead of shipping a new feature to 100% of users at once, you ship it to 1%, then 10%, then 50%, then everyone. If error rates spike at 10%, you stop. This is sometimes called a canary release or progressive delivery. Most modern flag tools do this with a percentage slider tied to a hash of the user ID, so the same user always gets the same experience between page loads.
Show variant A to half your users and variant B to the other half. Track which one converts better. The flag determines who sees what; an analytics tool measures the outcome. This is the use case most often confused with experimentation tools, but it's just a feature flag wired up to an event log.
Pete Hodgson's canonical Martin Fowler essay on feature toggles categorizes flags into four types, which is the taxonomy most teams have adopted:
The categorization matters because the lifecycle is different for each. A release flag should live for days or weeks. A permission flag will live for years. Mixing them in a single tool is fine, but mixing the lifecycles in your head is how you end up with a codebase full of dead flags from 2023.
The market is bigger than it should be for what is fundamentally a key-value store with a UI. Four options that cover most solo-founder use cases:
| Tool | Free tier | Best for | Catch |
|---|---|---|---|
| PostHog | 1M flag evaluations/mo | Founders who already use PostHog for analytics | Self-hosting is non-trivial |
| LaunchDarkly | 14-day trial only | Teams with a budget and complex targeting needs | Pricing is enterprise-coded |
| Unleash | Open source, self-host free | Privacy-focused founders OK with running infra | You operate it |
| Statsig | 1M events/mo | Founders who lead with experimentation | UI optimized for experiments, not ops |
For a solo founder, the right answer is almost always PostHog if you're already using it for analytics. The flag system is good enough, the SDK is small, and you avoid running yet another vendor. If you're not on PostHog, Unleash is the cleanest open-source option and Statsig has the most generous free tier among hosted experimentation-first tools.
You can also build your own flag system in a few hours. A row in your database with flag_name, enabled, and a percentage column gets you 80% of what these tools offer. It just won't have a UI for non-technical teammates — not a problem if there are no non-technical teammates.
The pragmatic stance. Most solo founders should add feature flags around their second or third deploy — once they have any real users. Adding them earlier is overkill; adding them later means you'll already have wished you had them.
A/B tests use feature flags as the underlying mechanism, but they're not the same thing. A flag controls who sees what. An A/B test adds an outcome measurement on top.
For binary on/off behavior that's the same for all users, yes. For percentage rollouts or per-user targeting, no — env vars are evaluated at deploy time, not per request.
A well-implemented client-side SDK adds less than 10 ms per evaluation, often single-digit. Server-side checks against an external service can add 50–200 ms unless you cache, which most SDKs do automatically.
Search your codebase for the flag key. Replace the flag check with whichever branch is now the permanent behavior. Delete the flag from your tool. Tools like LaunchDarkly and PostHog have stale-flag detection that flags candidates for cleanup.
They sit alongside analytics and error tracking. If you're building with AI tools, the workflow we describe in how to build SaaS with Claude assumes you'll add them once you have your first paying users.
The stack, prompts, pricing, and mistakes to avoid — for solo founders building with AI.