Description
Petri is a comprehensive toolset for running Flagsmith experiments directly within your development environment, including a VS Code extension, a copilot, and a command-line interface (CLI). Its primary purpose is to streamline the entire experiment lifecycle, from setup and monitoring to decision-making and cleanup, while preventing common data collection issues.
Read More
The tool proactively identifies and flags 20 different wiring bugs that can cause experiments to silently fail or skew data, such as incorrect event routing or misnamed events. These diagnostics appear in real-time as you type, helping developers fix issues before they impact live experiments. Petri also enhances visibility by displaying key metrics like lift and chance to win directly above the flag read in your code, alongside a detailed results panel with 95% confidence intervals.
Petri automates the decision-making process using a single, deterministic rule that ensures consistency between the UI and the copilot. This rule dictates when to ship a variant (e.g., at ≥ 95% confidence, with no guardrail issues or sample-ratio mismatches). Once a winner is decided, Petri can automatically ship the variant, manage flag states, and even delete the losing code path, all with explicit user approval for every change.
Designed for experiments that run for days, Petri includes features like "Treatment lock" to fingerprint code serving each arm, preventing mid-run changes, and "Petri Watch" which monitors hourly timelines for anomalies like drifting splits or conversion drops, linking them to specific commits. It also offers a "Health scorecard" for experiment quality and "Recount before launch" to verify data collection accuracy. Petri supports both self-hosted and Flagsmith Cloud instances and integrates seamlessly with various development workflows, including GitHub Actions and Codespaces.
- CategoryAI Code Review & Testing
- Pricing ModelFree
- DeploymentSelf-hosted, Cloud
- PlatformsVS Code, VSCodium, Windsurf, CLI, GitHub Actions, Codespaces
Petri's Core Features
20 real-time experiment diagnostics
CodeLens for lift and chance to win
Deterministic decision rule for shipping variants
Automated shipping of winning variants
Automated deletion of losing code paths
User approval for all changes
Treatment lock for experiment integrity
Petri Watch for hourly timeline monitoring
Health scorecard for experiment quality
Recount before launch for data verification
Experiment management via pull requests
Integration with VS Code, VSCodium, Windsurf
CLI for headless diagnostics
Support for self-hosted and Flagsmith Cloud
Audit trail of all Flagsmith writes and code changes
How to use Petri?
Install: Search for Petri in VS Code Extensions or use npx petri-check for CLI.
Connect: Link Petri to your Flagsmith instance, self-hosted or Cloud, via CLI or bootstrap.
Develop: Write experiment code; Petri will flag wiring bugs and suggest fixes as you type.
Monitor: View CodeLens for live experiment metrics and use the results panel for detailed insights.
Decide: Petri's rule engine will determine when to ship a winner based on pre-registered criteria.
Approve: Review and approve all proposed changes to flags, experiments, or code before they are applied.
Ship: Petri automates shipping the winning variant and cleaning up losing code paths after approval.
Petri's Use Cases
- A/B/n Experimentation
- Experiment Bug Prevention
- Real-time Experiment Monitoring
- Automated Experiment Decisions
- Code Cleanup and Management
- Ensuring Data Accuracy
- Experiment Integrity
- Developer Workflow Integration




