Before You Begin
To run this migration kit, you need:- The Confidence plugin installed in your AI assistant
-
The PostHog MCP server, authenticated with your PostHog account. For example, in Claude Code:
- The Confidence Flags MCP server, authenticated with your account
- The Confidence Documentation MCP server, used during code transformation
Run the Migration
Invoke the kit with the/confidence:migrate-posthog command in your AI assistant.
Plan the flag migration
Run
/confidence:migrate-posthog plan flag. The kit scans your PostHog feature flags, asks you to choose a Confidence client and entity, and writes a migration plan file.Review the plan
The plan lists every flag with its targeting conditions and rollout percentages, and marks anything that can’t migrate automatically. Plan files are resumable, so you can pause and continue later.
Execute the flag migration
Run
/confidence:migrate-posthog execute <plan-file>. The kit recreates each flag in Confidence with its targeting rules intact.Plan and execute the code migration
Run
/confidence:migrate-posthog plan code, review the plan, then execute it. If your app already uses OpenFeature, the kit swaps the registered provider and leaves call sites unchanged. Otherwise it rewrites each PostHog SDK call to the Confidence SDK, creating one pull request per flag.What Gets Migrated
| PostHog | Confidence |
|---|---|
| Feature flag | Flag with matching targeting rules |
| Multivariate flag | Variant assignments within a single rule, with percentage splits |
distinct_id bucketing | Entity field of your choice, such as user_id |
| Group-based bucketing | Group entity reference |
| Targeting conditions | Criteria and expression rules |
| Rollout percentage | Rollout percentage on the targeting rule |
Known Limitations
The kit flags these PostHog features for manual review because Confidence doesn’t support them:- The
icontainssubstring operator - The
is_not_setcondition - Cohort targeting
Analyze Historical Experiments
The migration kit moves your flags and code, not your historical experiment results. To re-analyze experiments that ran on PostHog, import their assignment data into your data warehouse and follow the Analyze a Past Experiment quickstart.Related Resources
Migrations Overview
How migration kits work and how to install the plugin
Use AI with Confidence
Set up the Confidence MCP servers for your AI assistant
Analyze a Past Experiment
Re-analyze experiments that ran on another platform
SDK Integration
Integrate Confidence SDKs into your application

