# Find stale flags and remove them from code

> Find stale flags and remove them from code: 2 companies fully do it, 4 with a limit, 10 carry the tag. Every listing in Product analytics & experimentation with the reason and a source.

- Canonical: https://www.anchorterminal.com/niches/product-analytics.stale-flag-cleanup/
- Markdown: https://www.anchorterminal.com/niches/product-analytics.stale-flag-cleanup/index.md (~1,300 tokens)
- Slim: https://www.anchorterminal.com/niches/product-analytics.stale-flag-cleanup/index.min.md (~280 tokens, same facts, less prose, for token-sensitive contexts)
- JSON: https://www.anchorterminal.com/niches/product-analytics.stale-flag-cleanup/index.json (this page as data, same URL with Accept: application/json)
- Site index for agents: https://www.anchorterminal.com/llms.txt (the key docs and every listing in one file, at most 16 MB, about 4 million tokens: https://www.anchorterminal.com/llms-full.txt)
- API: https://www.anchorterminal.com/api/v1/index.json
- MCP: https://www.anchorterminal.com/mcp (the whole catalogue as tools, no key)
- DNS: dig +short TXT <slug>.grade.anchorterminal.com (the grade as a DNS TXT record, for a sandbox with no HTTP where names still resolve; also top., best.<category>. and <a>.vs.<b>. under the zone, and the same under grade.letme.dev)
- Licence: CC BY 4.0, credit Anchor Terminal and link this page (https://www.anchorterminal.com/terms/#data)
- Updated: 2026-11-15

Two or three companies' docs show a full fit.

| Companies, full fit | With a limit | Carry the tag | Share of the category's work | First-hand accounts |
| --- | --- | --- | --- | --- |
| 2 | 4 | 10 | 5 | 3 |

## What counts as done

A list of flags with their staleness status and last evaluation per environment, and for each one marked ready, a pull request hard-coding the served variation.

Measured, for our own tests: within 10 calls per flag.

How agents ask for it: which flags can we delete; clean up fully rolled-out flags; remove the old checkout flag from the code

## Does the job

The docs show it meets the test above, and nothing we read says otherwise.

- **GrowthBook (GrowthBook, Inc.)**: GET /v2/stale-features returns isStale, a reason and staleByEnv with the value each environment evaluates to, and code-reference endpoints list usages per feature, so an agent can hard-code and open a pull request.
- **LaunchDarkly (Catamorphic, Co. (dba LaunchDarkly))**: search-stale-flags ranks candidates, get-flag-status-across-envs gives last evaluation per environment, get-removal-readiness checks code references and returns safe, caution or blocked, and the flag-cleanup skill hard-codes the variation and opens a pull request.

## Does the job, with a limit

It does the job, but something in the docs or a user's account will get in an agent's way. The limit is named in each row.

- **Flagsmith (Bullet Train Ltd)**: A Stale system tag, get_feature_code_references and get_feature_evaluation_data cover the inputs, but stale detection needs Scale-up or Enterprise plus feature versioning, and is based on last change, not last evaluation.
- **Harness Feature Management & Experimentation (Harness Inc.)**: Cleanup pipeline templates pick flags by natural-language criteria and open one pull request per flag, but they need a raw Anthropic key, and the MCP resources expose no staleness or last-evaluation field.
- **PostHog (PostHog Inc. (formerly Hiberly Inc.))**: feature-flags-status-retrieve reports active, stale or deleted, and the docs describe finding flags not evaluated in 90 days, but no MCP tool returns code references, so the agent must search the repository itself.
- **Statsig (Amplitude, Inc.)**: List Gates filters by type STALE and POST /gates/{id}/code_cleanup starts a cleanup, and a user praised the unused-flag detection (acc-25), but last evaluation per environment isn't a documented field.

- not this job: Amplitude (Amplitude, Inc.): Neither the MCP tool list nor the flag Management API exposes staleness, last evaluation or code references; only an archived filter.
- not this job: Countly (Countly Ltd): Remote-config tools list parameters, conditions and a Running or Stopped status, with no staleness, last-evaluation or code-reference data.
- not this job: Fullstory (Fullstory, Inc.): No feature flags.
- not this job: Heap (Content Square, Inc.): No feature flags.
- not this job: Matomo (InnoCraft Limited): No feature flags in Matomo.
- not this job: Mixpanel (Mixpanel, Inc.): Flag tools list, read and update flags and give lifecycle guidance, but expose no staleness, last-evaluation or code-reference fields.
- not this job: Mostly Good Metrics (Mostly Good Metrics): No feature flags.
- not this job: OpenPanel (OpenPanel AB): No feature flags.
- not this job: Optimizely Experimentation (Optimizely North America Inc.): Flags can be archived, but no staleness, last-evaluation or code-reference fields were found in the API index or MCP tools.
- not this job: Pendo (Pendo.io, Inc.): No feature flags.
- not this job: RudderStack MCP (RudderStack, Inc.): No feature flags.
- not this job: Userpilot (Userpilot, Inc.): No feature flags.
- not this job: Woopra (Woopra, Inc.): No feature flags.

## What stops agents finishing

- staleness and code-reference fields missing from the MCP tools
- delete is irreversible where archive exists

## Around it

After: code.open-pull-request.

## Where this comes from

Weight 5 of 100 in Product analytics & experimentation: 3 of 55 account links; LaunchDarkly and PostHog both ship a cleanup skill, so the vendor side is larger than the accounts

As data: https://www.anchorterminal.com/api/v1/use-cases/product-analytics.stale-flag-cleanup.json, or the MCP tool get_use_case with id product-analytics.stale-flag-cleanup. Draft, read 2026-11-15 from public docs and first-hand accounts, not yet reviewed by a person.

---

Query this catalogue directly over MCP: https://www.anchorterminal.com/mcp (Streamable HTTP, no key). How: https://www.anchorterminal.com/agents/#mcp
