Feature flag lifecycle management
Cleanup Policy

Feature Flags Need Cleanup Expectations, Not Just Naming Conventions

Naming conventions help teams find feature flags. Cleanup expectations tell developers and coding agents when a flag should be reviewed, what evidence to inspect, and which code path should remain.

6 min readUpdated May 2026

Name only

useful, but not enough

new-checkout-flow

The name helps search, but it does not answer:

  • when cleanup should start
  • which behavior becomes permanent
  • what evidence the agent must inspect

Cleanup expectation contract

the rule a coding agent can actually apply

Flag type
Release flag
Cleanup trigger
rollout reaches 100%, then 30 stable days
Coding rules
remove registry, evaluation helper, props, tests, tracking
Evidence
FeatBit audit, rollout state, repo refs, analytics
Decision
remove, retain, or needs-human-decision
Default cleanup clock by flag type

Release

100% rollout + 30 stable days

Experiment

decision recorded + 14 days

Migration

cutover validated + rollback window closed

Configuration

quarterly review or unchanged for 180 days

Put the rule near code

AGENTS.md, a project skill, or another repository rule file.

Archive only after deploy

The app should stop evaluating the flag before the FeatBit flag is archived.

What this page answers

  • Why a flag name such as new-checkout-flow is not enough to decide cleanup.
  • How cleanup expectations define timing, evidence, coding rules, dependencies, and end state.
  • Where to put cleanup rules so Codex, Claude Code, Copilot, FeatBit CLI, and FeatBit MCP workflows can use them.

A name is not a policy

A flag named new-checkout-flow tells an engineer what it probably controls. It does not say when cleanup starts, which branch should remain, which metrics matter, or which downstream systems must be checked.

That missing policy is why teams can have clean naming and still accumulate stale flags. A coding agent can search a name, but it still needs a cleanup expectation to decide whether the flag is removable, active, or blocked by missing evidence.

Start with type-based expectations

Release flags, experiment flags, operational flags, permission flags, migration flags, and configuration flags should not share one cleanup rule. They have different purposes and different end states.

A release flag might be reviewed 30 stable days after 100% rollout. An experiment flag should be removed after the decision and losing variants are no longer needed. A permission flag may be a long-lived business rule that is reviewed when packaging changes.

Put the policy where agents can read it

FeatBit stores useful evidence such as tags, creation time, rollout state, audit history, and experiment state. The cleanup policy itself should live in repository rules such as AGENTS.md, a project skill, or another file your coding tools read before making changes.

This turns cleanup from a remembered norm into an executable contract. The same rule can guide a developer review, an agent-assisted implementation, and a later cleanup pull request.

  • Define default review windows by flag type.
  • List lifecycle files such as flag registries, evaluation helpers, and client component props.
  • Record business dependencies for special flags.
  • Require code deployment before archiving or deleting the FeatBit flag.

Write the cleanup contract once

FeatBit's docs include a copyable cleanup expectation template for repository rules and agent skills.

Use the template