

Feature flags and A/B tests defined as markdown files in your repo, with a generated context file coding agents read on session start.

Feature flags and A/B tests defined as markdown files in your repo, with a generated context file coding agents read on session start.
Dif keeps feature flags and experiments in the repository instead of a separate dashboard: each flag, A/B test, holdout or staged rollout is one markdown file with YAML frontmatter under a dif/ folder, versioned in git and reviewed in a pull request like any other code. The CLI compiles those files into a tiny typed client plus a dif/context.json that coding agents such as Claude Code, Codex and Cursor read on session start, so prior experiment learnings travel with the work the way a CLAUDE.md does. Because everything is a file, git becomes the audit log and PR review becomes the approval flow, with no separate change history to reconcile against the code. The build resolves an exclusion graph and refuses to compile when two live tests would bucket the same user, so conflicts break in CI rather than in production. Audience targeting declares which attributes you segment on while the actual values arrive at runtime from your app, so no customer list is ever committed. The CLI and SDK are free; Dif Cloud is an optional hosted layer for live pulse and team metrics billed on a single event meter.
Feature flags and A/B tests defined as markdown files in your repo, with a generated context file coding agents read on session start.
dif.sh works by combining Markdown-Defined Experiments: One .md file per flag or test holds id, status, owner, surface, hypothesis, audience, variants, metrics and guardrails in frontmatter, with the brief and rationale written below it., Agent Context File: Every dif build regenerates dif/context.json listing active flags, experiments, variants and recent learnings, which coding agents pick up on session start., Build-Time Conflict Detection: The build resolves an exclusion graph and refuses to compile when two live tests would bucket one user into both, so clashes break in CI instead of production., One Shape for Four Concepts: Feature flags, A/B tests, holdouts and staged rollouts are the same file format with different frontmatter, reducing the number of concepts and failure modes., Generated Typed Client: dif build emits a small typed client you import once at boot, then call per flag with control and variant branches — supported for web server, React and Svelte. to help users with Keeping Experiments in Code Review: Ship flag and experiment changes through the same pull request flow as the code they gate, using git history as the audit trail., Giving Coding Agents Experiment Context: Let an AI coding agent see which experiments are live on a surface and what prior tests taught before it edits that screen., Preventing Overlapping Tests: Use exclusion groups to guarantee no user is bucketed into two conflicting experiments, caught at build time rather than discovered in the results., Running Staged Rollouts: Ramp a new feature to a growing share of traffic using the same file format as an A/B test, without learning a separate rollout tool., Instrumenting Without a Vendor Lock-In: Forward exposure and result events to an existing analytics warehouse instead of adopting a hosted experimentation database..
Key features include Markdown-Defined Experiments: One .md file per flag or test holds id, status, owner, surface, hypothesis, audience, variants, metrics and guardrails in frontmatter, with the brief and rationale written below it., Agent Context File: Every dif build regenerates dif/context.json listing active flags, experiments, variants and recent learnings, which coding agents pick up on session start., Build-Time Conflict Detection: The build resolves an exclusion graph and refuses to compile when two live tests would bucket one user into both, so clashes break in CI instead of production., One Shape for Four Concepts: Feature flags, A/B tests, holdouts and staged rollouts are the same file format with different frontmatter, reducing the number of concepts and failure modes., Generated Typed Client: dif build emits a small typed client you import once at boot, then call per flag with control and variant branches — supported for web server, React and Svelte..
dif.sh is useful for anyone interested in Keeping Experiments in Code Review: Ship flag and experiment changes through the same pull request flow as the code they gate, using git history as the audit trail., Giving Coding Agents Experiment Context: Let an AI coding agent see which experiments are live on a surface and what prior tests taught before it edits that screen., Preventing Overlapping Tests: Use exclusion groups to guarantee no user is bucketed into two conflicting experiments, caught at build time rather than discovered in the results., Running Staged Rollouts: Ramp a new feature to a growing share of traffic using the same file format as an A/B test, without learning a separate rollout tool., Instrumenting Without a Vendor Lock-In: Forward exposure and result events to an existing analytics warehouse instead of adopting a hosted experimentation database..
dif.sh offers a free tier with paid plans for advanced features.
Visit https://www.dif.sh/ to sign up and explore dif.sh.
Compare dif.sh: vs Ponytail · vs GitWarren · vs Chalked · vs Causal