cleaning-up-stale-feature-flags

Detect stale PostHog feature flags and generate safe cleanup plans.

58|5|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/PostHog/skills --skill cleaning-up-stale-feature-flags
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cleaning-up-stale-feature-flags
Source: https://github.com/PostHog/skills/tree/main/skills/omnibus/cleaning-up-stale-feature-flags
Command: npx skills add https://github.com/PostHog/skills --skill cleaning-up-stale-feature-flags

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Identify and clean up stale feature flags in a PostHog project to reduce technical debt and prevent unused or misconfigured flags from affecting experiments and deployments.

Core Features & Use Cases

  • Staleness detection: identify flags with no usage data for 30+ days or fully rolled out with no conditions.
  • Risk-aware assessment: check for experiment ties and dependencies before cleanup.
  • Cleanup guidance: generate a safe code-change plan and actions (disable or delete) with step-by-step prompts.

Quick Start

Follow the workflow to scan for stale flags, assess each candidate, and produce a safe cleanup plan.

Frequently Asked Questions about cleaning-up-stale-feature-flags

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean up stale feature flags in PostHog?

To clean up stale PostHog feature flags, scan for flags with no usage data for 30+ days or those fully rolled out. The workflow assesses experiment dependencies and generates a safe step-by-step removal plan.

What makes a feature flag stale?

A feature flag is considered stale if it has no usage data for 30 or more days, is fully rolled out with no conditions, or has aged without active deployment ties, accumulating technical debt and cluttering deployments.

How do I safely delete feature flags tied to experiments?

To safely delete feature flags tied to experiments, perform risk-aware dependency checks first to detect experiment ties and dependencies before cleanup, providing recommended actions to disable or delete without breaking deployments.

Does PostHog support automated feature flag dependency checks?

Yes, PostHog supports dependency checks through this cleanup workflow, which evaluates flags for experiment ties and dependencies before removal, generating a cleanup prompt with recommended actions to ensure safe deletion.

What is the best way to prune unused feature flags?

The best way to prune unused feature flags is to use a risk-aware assessment workflow that identifies stale candidates through usage data, checks for experiment dependencies, and generates a step-by-step cleanup plan.