Skip to content
dif.sh logo

Feature flags and A/B testing versioned in your git repo

Visit Website
Tracked since2026

The Bottom Line

Entry price

Free plan available, paid tiers above

Biggest pro

Simplifies experiment management by keeping everything in the repo alongside code.

Biggest con

Requires CLI setup and familiarity with markdown frontmatter; less visual than GUI-based tools.

TL;DR - dif.sh

  • Manage feature flags and A/B tests as markdown files in your repo, versioned with git and reviewed in PRs.
  • Free CLI and SDK for local experimentation; optional cloud tier for live metrics and team collaboration.
  • Built-in conflict detection, exclusion groups, and audience targeting without committing customer data.
Pricing: Free plan available
Best for: Growing teams

What is dif.sh?

Editorial review
dif.sh is a developer tool that brings feature flags and A/B testing directly into your code repository. Instead of relying on a separate service, each flag or experiment is a single markdown file with structured frontmatter, versioned in git and reviewable in pull requests. The CLI and SDK are free and open-source, allowing you to define experiments, run builds that detect conflicts, and generate a context file that coding agents can read on startup. An optional cloud layer provides live metrics, team dashboards, and PR write-back, billed per event with unlimited seats.

Pros & Cons

Pros

  • Simplifies experiment management by keeping everything in the repo alongside code.
  • No separate service needed for basic use; free CLI and SDK work offline.
  • Built-in conflict detection prevents invalid experiment combinations before they reach production.

Cons

  • Requires CLI setup and familiarity with markdown frontmatter; less visual than GUI-based tools.
  • Advanced metrics and team dashboards require the paid cloud tier.
  • Primarily designed for developer teams; non-technical stakeholders may find the file-based approach less accessible.

Key Features

File-based experiments: each flag or test is a single .md file with frontmatter for id, status, variants, metrics, and audience rules.Git-native workflow: experiments are versioned, reviewed in PRs, and git serves as the audit log.Conflict detection at build: dif build resolves exclusion graphs and fails if two live tests would collide on the same user.Exclusion groups: one frontmatter line prevents users from being bucketed into multiple overlapping experiments.Audience targeting: declare attributes in config.yaml, values arrive at runtime from user context; no customer data is committed.Guardrails: define secondary metrics (e.g., refund_rate) that compile into the client to monitor side effects.Coding agent integration: dif build regenerates dif/context.json with active experiments and learnings for agents to read on session start.Custom event forwarding: use dif init --events custom to send results to Segment, Amplitude, or your own warehouse.

Pricing

Freemium

dif.sh offers a generous free tier with optional paid upgrades for advanced features.

View pricing

Reviews

Improve Your Thinking Patterns Using ChatGPT cover
$99Free with your review

Review dif.sh, get a free AI guide

Share your experience and we will send you Improve Your Thinking Patterns Using ChatGPT, free.

Write a review

Best dif.sh Alternatives

Top alternatives based on features, pricing, and user needs.

View full list →

Most buyers shortlist 2 or 3 tools before committing. Pull a side-by-side comparison or browse the full alternatives shortlist below.

Explore More

dif.sh FAQ

How does dif.sh handle experiment conflicts?

The dif build command resolves an exclusion graph and refuses to compile when two live tests would collide on the same user. It breaks in CI, not in production, ensuring no user is bucketed into conflicting experiments.

Can I use dif.sh without the cloud service?

Yes. The CLI and SDK are free and open-source, and you can run experiments entirely from your repo. The cloud layer is optional and adds live pulse, a metrics catalog, and PR write-back.

How does dif.sh integrate with coding agents?

Every dif build regenerates dif/context.json, which contains active flags, experiments, variants, and recent learnings. Coding agents read this file on session start, similar to a CLAUDE.md for experiments.

What happens when I conclude an experiment?

The dif conclude command archives the experiment file to dif/experiments/concluded/, drafts a Decision block in the file, and appends one line to the surface log so the next test starts informed.

How is event billing calculated on the cloud plan?

Each exposure recorded by the SDK and each result tracked via dif.track() counts as one event. Deduped retries and rejected payloads are free. Events pool across all projects in a workspace, and there is a spend cap to prevent runaway bills.

Can I send experiment results to my own analytics platform?

Yes. Use dif init --events custom to own two handlers that forward events to Segment, Amplitude, or your warehouse. Alternatively, add a Dif Cloud key and dif.track() computes lift for you without join code.

How does audience targeting work without committing customer data?

You declare audience attributes (e.g., country, plan, returning_visitor) in dif/config.yaml. Values arrive at runtime from your app's user context, so no customer list is ever committed to the repository.

What is the difference between a flag, an A/B test, a holdout, and a staged rollout in dif.sh?

They are all the same markdown file format with different frontmatter. A flag uses a single variant, an A/B test has multiple variants with weights, a holdout reserves a percentage of users, and a staged rollout gradually increases exposure. Fewer concepts to learn and fewer ways to introduce bugs.

Source: dif.sh

Guides & Articles