Flag Sweep: agent-written cleanup PRs for stale feature flags
A GitHub app that finds fully rolled-out flags and opens tested removal PRs. Startup engineering teams pay per repo.
Crowded · DoorDash paper: 1,659 stale flags
Written for: Solo builder
Next step
This week, build a CLI that pulls 100%-rollout flags from the PostHog or GrowthBook API, finds their references with ripgrep, and has a coding model draft one removal diff per flag. Recruit five testers from the PostHog and GrowthBook community Slacks.
Why now
Until now this was a recipe only big companies could build in-house. The paper shows the approach works at scale, coding models are cheap enough to draft a diff per flag, and the flag platforms (PostHog, GrowthBook, Unleash, LaunchDarkly) expose rollout status through APIs. Teams of 20 to 200 engineers carry the same debt without a platform team to fix it.
What became possible
DoorDash published an industrial report on cleaning up feature flags with a multi-agent LLM system. It has 56,000 flags across 623 repos, 1,659 of them stale, and each takes one to two hours to remove by hand. The paper says existing rule-based cleanup tools fall short.
Two ways in
- Flag Sweep GitHub App
Reads the flag platform's API for flags at 100% rollout for 30+ days, finds code references, removes the dead branch, runs the test suite and opens a PR explaining what changed.
- Customer
- Series A–C startups using PostHog, GrowthBook or LaunchDarkly
- Model
- $20 per repo per month, or $5 per merged PR
- flagsweep OSS CLI
Local, open-source version for self-hosted GrowthBook and Unleash users. It doubles as the funnel for the paid app.
- Customer
- Individual engineers stuck with flag cleanup
- Model
- Free, with an upgrade path to the hosted app
Competition
The core loop is taken. Finding fully rolled-out flags, removing the dead branch, running tests and opening a PR is now offered free or bundled by the flag vendors (LaunchDarkly Vega, Reflag, Harness, Unleash's MCP workflow, PostHog's docs), by FlagShark as a free GitHub Action, and by open source (bye-bye-flag for PostHog, Uber Piranha).
Full competition notes (12 competitors)
The core loop is taken. Finding fully rolled-out flags, removing the dead branch, running tests and opening a PR is now offered free or bundled by the flag vendors (LaunchDarkly Vega, Reflag, Harness, Unleash's MCP workflow, PostHog's docs), by FlagShark as a free GitHub Action, and by open source (bye-bye-flag for PostHog, Uber Piranha). The proposed OSS CLI in particular has a near-exact existing equivalent in bye-bye-flag. The remaining opening is narrow. GrowthBook turned up no specific tooling, so a provider-neutral app covering GrowthBook, PostHog and Unleash together, including self-hosted setups, is a possible wedge. To justify charging per repo, a new entrant would need to stand out on safety rather than on opening the PR. That means verifying in production that the flag is no longer being evaluated, finding references across several repos and across client and server code, checking that tests actually exercise the branch being kept, and cleaning up leftover config, tests and the flag record. Even then, pricing pressure from free tools and features bundled into the platforms makes a standalone paid product hard to sustain for Series A to C startups.
- FlagShark
Free GitHub Action that detects stale flags, comments on PRs and opens removal PRs (Piranha-based, 8 of 13 languages); also has a LaunchDarkly-specific cleanup product. Closest direct competitor.
- LaunchDarkly Vega flag cleanup
Built-in agent that confirms a flag has a single evaluated variation in critical environments, then opens a GitHub removal PR. LaunchDarkly also publishes an agent skill covering readiness checks, code removal, test verification and PR template.
- Reflag (formerly Bucket) AI code clean-up
Reflag bot opens a GitHub PR removing flag code automatically once a flag turns stale; beta, best on React SDK.
- bye-bye-flag (Relevance AI, open source)
OSS tool that reads PostHog for flags at 0%/100% for 30+ days, runs AI agents in worktrees to remove them and opens draft PRs; nearly identical to the proposed CLI.
- Harness automated feature flag cleanup
Pipeline templates using Claude that generate one cleanup PR per stale flag.
- Gitar (SonarSource)
Automatically creates PRs/MRs cleaning up stale LaunchDarkly flags, built on Polyglot Piranha.
- Uber Piranha
Open-source stale-flag code deletion engine underlying several of these products.
- Augment Code feature flag cleanup workflow
Scans LaunchDarkly, Statsig, Unleash or homegrown flags for fully rolled-out flags and opens cleanup PRs assigned to owners.
- Unleash AI flag cleanup with Copilot/MCP
Vendor-provided issue-driven agent workflow using the Unleash MCP cleanup_flag tool to remove flag code.
- PostHog stale flag cleanup docs
PostHog documents AST-based and agent-driven stale flag removal for its own users.
- DoorDash multi-agent flag cleanup (internal)
Internal system producing merge-ready PRs for 45 of 50 stale flags at about $4.79 per flag; evidence that large companies build this themselves.
- Atlassian agentic pipelines flag cleanup (internal)
Bitbucket pipeline that triggers a coding agent from Jira flag-cleanup tickets; engineers review and merge the PRs.
Checked 2026-10-23
Risks
- LaunchDarkly or PostHog can ship cleanup as a built-in feature
- A wrong branch removal causes an outage, so trust takes a while to earn
- Small teams may have too few flags to feel the pain
Strong team fit; market pull and open space are the weak point (6).
tech 7 · pull 6 · space 6 · fit 8 · build 7
Exposed
Companies that could benefit or be threatened. News and context, not investment advice.
Momentum of its main topic
Sources
Status history
- 2026-10-23 Flagged as buildable