Loading...
Split.io's treatment model means every flag can have multiple variants — not just on/off. FlagShark parses your TypeScript to find every `getTreatment` call, matches treatments against your Split dashboard, and identifies variants that are no longer needed.
FlagShark generates a PR that removes the dead branch and keeps only the winning code path
import { SplitFactory } from '@splitsoftware/splitio';
const factory = SplitFactory({ core: { authorizationKey: SDK_KEY, key: userId } });
const client = factory.client();
async function renderPage() {
await client.ready();
const treatment = client.getTreatment('checkout-flow');
if (treatment === 'express') {
return <ExpressCheckout />;
} else if (treatment === 'standard') {
return <StandardCheckout />;
}
return <StandardCheckout />; // control
}async function renderPage() {
return <ExpressCheckout />;
}FlagShark uses AST parsing with ts-morph for precise SDK call detection to find every call to getTreatment(), getTreatments(), track()across your React, Next.js, Node.js codebase.
Each detected flag key is matched against your Split.io project to check rollout status, last evaluation date, and whether the flag is archived or still active.
For each stale flag, FlagShark creates a pull request that removes the SDK call, eliminates the dead code branch, and preserves the winning path. Every PR includes a before/after diff you can review.
Split treatments are strings, not booleans — a simple `if/else` refactor isn't always safe because the "control" treatment (returned when Split can't reach its servers) might be a distinct code path you need to preserve temporarily.
Grep misses flags behind abstractions. AST-level scanning catches SDK calls that regex can't.
Every cleanup goes through code review. No surprises, no broken builds.
Only flags at 100% rollout for your configured threshold are suggested for removal.
New stale flags are detected automatically. Your codebase stays clean without manual audits.
getTreatment()getTreatments()track()Plus custom patterns you define in .flagshark.yaml
FlagShark traces `SplitFactory` initialization and every subsequent `getTreatment` / `getTreatments` call using ts-morph AST analysis. It resolves the treatment string comparisons to map each code branch to a Split treatment value.
Yes. Unlike simple boolean flags, Split treatments can have many variants. FlagShark reads your Split definition to determine the winning treatment and removes all dead branches while preserving the winner.
FlagShark identifies `track` calls that are co-located with flag checks. When a flag is removed, it flags related tracking calls for review — some may still be needed for analytics even after the experiment ends.
Connect your repo, see stale flags in minutes, and get cleanup PRs automatically.
Free tier available • No credit card required • 5-minute setup
Find and clean up stale Split.io feature flag treatments in Django, FastAPI, and Flask projects.
Identify and safely remove stale Split.io treatments from Go services using AST-based analysis.
Systematically find and remove stale Split.io treatments from Spring Boot and Micronaut applications.
Detect and clean up stale Split.io feature flags in Rails and Sinatra applications.
A hands-on guide to finding and safely removing stale LaunchDarkly feature flags from TypeScript and React codebases.
Find and remove stale Unleash feature toggles from React, Next.js, and Node.js TypeScript projects.
Detect and remove abandoned PostHog feature flags from React and Next.js TypeScript applications.
Find and safely remove stale Flagsmith flags from React and Node.js TypeScript codebases.
Detect and remove stale ConfigCat feature flags from React and Node.js TypeScript projects.