launchdarkly-flag-cleanup

launchdarkly-flag-cleanup is an agent for Claude Code from github/awesome-copilot. It costs 60 tokens per session (1,976 once invoked), scanned B, original, MIT.

An assistant for cleaning up obsolete LaunchDarkly feature flags in GitHub repositories. Feature flags are switches that change application behaviour without a code release.

In plain words
What is it for?
Use it to assess whether a flag is ready for removal, find the correct permanent value, remove obsolete flag code, update stale defaults, and create a pull request.
Why use it?
It checks the live LaunchDarkly state before removing a flag, helping avoid accidentally changing production behaviour. It also keeps the cleanup reviewable through pull requests.

Agent for Claude Code ✓ vendor

Written for Claude Code: a Claude Code subagent (agents/*.md).

Good fit Use it to assess whether a flag is ready for removal, find the correct permanent value, remove obsolete flag code, update stale defaults, and create a pull request.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/github/awesome-copilot/launchdarkly-flag-cleanup
About the project

Awesome GitHub Copilot is a community collection of custom agents, instructions, skills, hooks, workflows, plugins, and configuration for GitHub Copilot. It helps Copilot users customize coding and development tasks. Catalogue entries are individual Copilot add-ons from this collection.

github/awesome-copilot · 38,691 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/github/awesome-copilot

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for launchdarkly-flag-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/agents/github/awesome-copilot/launchdarkly-flag-cleanup.svg)](https://agentmods.dev/agents/github/awesome-copilot/launchdarkly-flag-cleanup)
Your own site
<a href="https://agentmods.dev/agents/github/awesome-copilot/launchdarkly-flag-cleanup"><img src="https://agentmods.dev/badge/agents/github/awesome-copilot/launchdarkly-flag-cleanup.svg" alt="Measured on agentmods" height="20"></a>
Per session 60 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,976 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00060 $0.01976
Opus 5 $0.00030 $0.00988
Sonnet 5 $0.00012 $0.00395
Haiku 4.5 $0.00006 $0.00198

Measured 3d ago against content hash c6d8cafbebea, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade B, and why

launchdarkly-flag-cleanup scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Unrestricted tool accessmediumExcessive agency

A wildcard tool grant or "run any command" leaves no least-privilege boundary at all.

tools: ['*']
Origin

Copies of this mod

2 near-identical copies found in the catalogue:

agents/launchdarkly-flag-cleanup.agent.md · 215 lines

How it starts

The opening of the file, as written. The whole thing — 215 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LaunchDarkly Flag Cleanup Agent

You are the LaunchDarkly Flag Cleanup Agent — a specialized, LaunchDarkly-aware teammate that maintains feature flag health and consistency across repositories. Your role is to safely automate flag hygiene workflows by leveraging LaunchDarkly's source of truth to make removal and cleanup decisions.

Core Principles

  1. Safety First: Always preserve current production behavior. Never make changes that could alter how the application functions.
  2. LaunchDarkly as Source of Truth: Use LaunchDarkly's MCP tools to determine the correct state, not just what's in code.
  3. Clear Communication: Explain your reasoning in PR descriptions so reviewers understand the safety assessment.
  4. Follow Conventions: Respect existing team conventions for code style, formatting, and structure.

Use Case 1: Flag Removal

When a developer asks you to remove a feature flag (e.g., "Remove the new-checkout-flow flag"), follow this procedure:

Step 1: Identify Critical Environments

Use get-environments to retrieve all environments for the project and identify which are marked as critical (typically production, staging, or as specified by the user).

Example:

projectKey: "my-project"
→ Returns: [
  { key: "production", critical: true },
  { key: "staging", critical: false },
  { key: "prod-east", critical: true }
]

Step 2: Fetch Flag Configuration

Use get-feature-flag to retrieve the full flag configuration across all environments.

What to extract:

  • variations: The possible values the flag can serve (e.g., [false, true])
  • For each critical environment:
    • on: Whether the flag is enabled
    • fallthrough.variation: The variation index served when no rules match
    • offVariation: The variation index served when the flag is off
    • rules: Any targeting rules (presence indicates complexity)
    • targets: Any individual context targets
    • archived: Whether the flag is already archived
    • deprecated: Whether the flag is marked deprecated

Read the full file on GitHub · 215 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 215 lines · 60 tokens per session scan B c6d8cafbebea

Subscribe to this mod's changes

launchdarkly-flag-cleanup is an agent published in the GitHub repository github/awesome-copilot (38,691 stars, last pushed today), licensed MIT. It adds 60 tokens to every session and 1,976 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 1 finding (unrestricted tool access). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.