Official agent skill

Finding Deleted Feature Flags

by PostHog in PostHog/posthog-foss

Find feature flags that were soft-deleted in the active project within a recent time window.

OfficialMITAuto-check passed

Install Finding Deleted Feature Flags

skills CLI
$ npx skills add PostHog/posthog-foss --skill finding-deleted-feature-flags -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install PostHog/posthog-foss finding-deleted-feature-flags --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/PostHog/posthog-foss.git skills-src && mkdir -p .claude/skills && cp -r skills-src/products/feature_flags/skills/finding-deleted-feature-flags .claude/skills/finding-deleted-feature-flags && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
finding-deleted-feature-flags
GitHub stars
721
Token cost
~2k tokens
SKILL.md length
887 words
Files
2 (incl. scripts)
Skills in repo
213
Repo updated
First seen
Licence
MIT

At a glance

Find feature flags that were soft-deleted in the active project within a recent time window.

  • Works in 5 steps: Clarify the window if ambiguous → Enumerate soft-deleted flags via SQL → Fan out activity-log lookups in parallel → …
  • The user asks what flags were deleted in the last N days
  • SKILL.md covers When to use this skill, The gotcha that makes this…, Workflow and Watch-outs, plus 3 more sections
  • Runs Python scripts from its folder; calls python3

What it does

Finding Deleted Feature Flags is an agent skill from PostHog/posthog-foss, published by the product's own GitHub organization. Find feature flags that were soft-deleted in the active project within a recent time window. Use when the user asks "what flags were deleted in the last N days", "show me recently deleted feature flags", "who deleted flag X", "audit recent flag deletions", or anything similar. Handles the non-obvious gotcha that system.featureflags exposes the deleted boolean but does not expose a deletion timestamp — the actual deleted-at time lives in the per-flag activity log and must be cross-referenced.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/strip_deleted_suffix.py`).

It works with PostHog and SQL. The repository describes itself as: PostHog FOSS is a read-only mirror of PostHog, with all proprietary code removed. NOTE: This repo is synced automatically from the main PostHog repo. Please raise any issues and… The licence is MIT.

When your agent uses it

  • The user asks what flags were deleted in the last N days
  • Show me recently deleted feature flags
  • Who deleted flag X
  • Audit recent flag deletions

Example prompts

  • “what flags were deleted in the last N days”
  • “show me recently deleted feature flags”
  • “who deleted flag X”
  • “/finding-deleted-feature-flags”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Clarify the window if ambiguous
  2. Enumerate soft-deleted flags via SQL
  3. Fan out activity-log lookups in parallel
  4. Extract the deletion event from each response
  5. Recover the original key and report

What it can do on your machine

Read from SKILL.md and the folder at commit 2c48221. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Finding Deleted Feature Flags loads about 2k tokens when it runs. Until then it costs about 132 tokens; SKILL.md has 887 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~132
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from PostHog/posthog-foss at commit 2c48221, republished under its MIT licence (© PostHog). 887 words, ~1,958 tokens.

Download SKILL.mdSave it as .claude/skills/finding-deleted-feature-flags/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
finding-deleted-feature-flags
description
Find feature flags that were soft-deleted in the active project within a recent time window. Use when the user asks "what flags were deleted in the last N days", "show me recently deleted feature flags", "who deleted flag X", "audit recent flag deletions", or anything similar. Handles the non-obvious gotcha that system.feature_flags exposes the deleted boolean but does not expose a deletion timestamp — the actual deleted-at time lives in the per-flag activity log and must be cross-referenced.

Finding recently deleted feature flags

This skill produces a list of feature flags that were soft-deleted in the active project within a user-specified time window, along with who deleted each one and when.

When to use this skill

  • The user asks "what flags got deleted last week / in the last N days?"
  • The user wants an audit of recent flag deletions (who, when, what was removed)
  • The user wants to find when a specific flag was deleted, or by whom
  • Any "recently deleted feature flags" framing

Don't use this for active stale-flag cleanup — that's cleaning-up-stale-feature-flags. This skill is for flags that have already been removed.

The gotcha that makes this non-trivial

system.feature_flags exposes deleted as a boolean but does not expose deleted_at, updated_at, or last_modified_at. There's no way to filter soft-deleted flags by deletion time in a single SQL query — trying to use those columns will return Unable to resolve field.

The actual deletion timestamp lives in the per-flag activity log, reachable only via posthog:feature-flags-activity-retrieve (one call per flag id). There is no bulk activity endpoint.

So the workflow is two-stage: SQL to enumerate candidates, then parallel activity-log lookups to find each deletion event.

Workflow

1. Clarify the window if ambiguous

"Last week" is ambiguous — it can mean rolling 7 days from now, or the previous calendar week (Mon–Sun). If the user wasn't explicit, ask, or surface both interpretations in the final report.

Always compute the cutoff in UTC and keep the user's local interpretation in your head separately.

2. Enumerate soft-deleted flags via SQL

Query system.feature_flags for deleted = true in the active project, ordered by created_at DESC:

sql
SELECT id, key, created_at
FROM system.feature_flags
WHERE team_id = <team_id> AND deleted = true
ORDER BY created_at DESC
LIMIT 100

Order by created_at DESC because deletions empirically cluster near creation — most flags get deleted within a few days of being created — so walking the most-recently-created candidates first finds recent deletions fastest. But this is a heuristic, not a guarantee: an older flag deleted recently won't be at the top of this list. Be explicit about that limitation when you report.

team_id defaults to the active project, but include it explicitly for clarity.

3. Fan out activity-log lookups in parallel

For each candidate id, call posthog:feature-flags-activity-retrieve with limit: 5, page: 1. Issue all calls in one message so they run concurrently — sequential calls are dramatically slower.

text
call feature-flags-activity-retrieve {"id": <flag_id>, "limit": 5, "page": 1}

Reasonable batch sizes:

  • "last 7 days" → top 20–25 candidates
  • "last 30 days" → top 50
  • "last 90 days" → walk the full ~100

If you sample fewer than the full set, say so in the report and offer to walk the rest as a follow-up.

4. Extract the deletion event from each response

In each response, find the entry where activity == "deleted". That entry's created_at is the actual deletion time, and user.email / user.first_name identify the deleter. These fields are reliable on every delete path.

For most flags there's exactly one delete event. If a flag has been deleted-and-restored multiple times, take the most recent activity: deleted event within the window.

5. Recover the original key and report

Feature flags are renamed to <original>:deleted:<flag_id> when soft-deleted while still referenced elsewhere (e.g. a stopped experiment) — the id-based suffix frees the original key for reuse. Don't try to recover the original from the activity log's own fields: detail.changes only carries the rename on UI/ORM deletes (and is often empty, or missing the key entry, on API/MCP/programmatic deletes), and detail.name just mirrors whatever the current key is — tombstoned or not.

Instead, strip the suffix deterministically with scripts/strip_deleted_suffix.py. Pass it the whole step 2 candidate list as JSON in one call — not one invocation per flag:

bash
echo '[{"id": 1001, "key": "example-banner:deleted:1001"}]' | python3 scripts/strip_deleted_suffix.py
# prints the same array back (pretty-printed), each object gaining an "original_key" field:
# "original_key": "example-banner"

Filter the collected deletion events to those whose created_at falls inside the requested window. Present as a table, using each row's recovered original key (not the raw tombstoned form) for the "Key" column:

| Flag ID | Key | Deleted at (UTC) | Deleted by |

State your methodology in the report (how many candidates you walked vs. how many soft-deleted flags exist total), so the user knows what was and wasn't checked.

Show full SKILL.md (323 more words)Show less

Watch-outs

  • Borderline cases: if a deletion is within ~1 hour of the window cutoff, surface it as borderline rather than silently dropping it.
  • Don't trust created_at as a proxy for deletion time: a flag created in 2024 can still have been deleted last week. The activity log is the only authority.
  • Renamed keys are normal: a flag with key foo:deleted:12345 was the flag originally keyed foo — see step 5 for how to recover it.
  • Walking all candidates is possible but slow: ~100 parallel activity-log calls is doable. Offer it as a follow-up rather than the default for short windows.

Example interaction

User: "what flags got deleted in the last week?"

  1. Clarify if needed, or note both interpretations: "rolling 7 days ending now (UTC), in the active project"

  2. Run the SQL enumeration to get up to 100 soft-deleted candidates ordered by created_at DESC

  3. Fan out activity-log lookups in parallel across the top ~25 candidates

  4. Extract activity: deleted entries; filter to those whose created_at >= now - 7 days

  5. Recover original keys with scripts/strip_deleted_suffix.py and report. The values below are illustrative, not real project data:

    text
    Found 2 feature flags deleted in the last 7 days (rolling, ending 2026-08-14 09:30 UTC):
    
    | Flag ID | Key                     | Deleted at (UTC)     | Deleted by  |
    |---------|-------------------------|----------------------|-------------|
    | 1001    | example-banner          | 2026-08-13 15:12     | Jane D.     |
    | 1002    | example-checkout-test   | 2026-08-09 21:48     | John S.     |
    
    Methodology: walked the activity log for the 25 most-recently-created soft-deleted flags.
    The step 2 query hit its 100-row cap, so the project may have more soft-deleted flags than that.
    The other 75 returned candidates were created before late June 2026 and were not checked.
    Want me to walk the rest?
  • posthog:execute-sql: Used in step 2 to enumerate soft-deleted candidates against system.feature_flags
  • posthog:feature-flags-activity-retrieve: Used in step 3 to find the actual deletion event for each candidate
  • posthog:feature-flag-get-definition: Useful if the user then wants to inspect what the deleted flag looked like

Scripts

© PostHog, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in products/feature_flags/skills/finding-deleted-feature-flags of PostHog/posthog-foss.

  • SKILL.md
  • scripts/strip_deleted_suffix.py

Open the folder on GitHubat commit 2c48221

Compare with similar skills

Finding Deleted Feature Flags next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Finding Deleted Feature Flags compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Finding Deleted Feature Flags this skillPostHog/posthog-foss721—~2kAutomated safety check: PassMIT
Analyticsericrisco/rsc-harness156—~2.8kAutomated safety check: PassMIT
Almost Paidnestyme/awesome-prompts149—~3.9kAutomated safety check: PassNone
Metabase Prod Queryhaacked/dotfiles134—~1.5kAutomated safety check: NotesNone
Excel and CSV Data Analysisbytedance/deer-flow83k4 repos~2.2kAutomated safety check: PassMIT
Django Filter Benchmarksaleor/saleor23k—~2.3kAutomated safety check: PassBSD-3-Clause

Similar skills

  • Analytics

    ericrisco/rsc-harness

    A skill your agent uses when instrumenting product or web analytics — GA4/PostHog SDK wiring, event taxonomy, funnels, double-counted events, consent gating, PII scrubbing.

    156 GitHub stars~2.8k tokensUpdated yesterday
    Marketing & SEOAuto-check passed
  • Almost Paid

    nestyme/awesome-prompts

    Find the users who almost paid — saw the paywall, started checkout, ran out of free credits, let a trial lapse — size what they are worth, and turn them into a one-screen dashboard with a…

    149 GitHub stars~3.9k tokensUpdated 7 days ago
    Data & AnalyticsAuto-check passed
  • Metabase Prod Query

    haacked/dotfiles

    Query PostHog production Metabase. An agent skill from haacked/dotfiles.

    134 GitHub stars~1.5k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Excel and CSV Data Analysis

    bytedance/deer-flow

    Analyzes uploaded Excel and CSV files with SQL through DuckDB, producing schema inspections, statistical summaries and exports to CSV, JSON or Markdown.

    83k GitHub starsUsed in 4 repos~2.2k tokens
    Data & AnalyticsAuto-check passed
  • Benchmarks Django ORM filters in Saleor by generating bulk data, extracting the SQL and running EXPLAIN ANALYZE to check index usage.

    23k GitHub stars~2.3k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Geoflow

    yaojingang/GEOFlow

    Operate/develop GEOFlow CLI/Laravel/admin/API, topics/专题 and topic tasks, theme libraries/replication, sites/leads/Agent, channel sync and legacy yao-geoflow-cli/design/template migration.

    3.8k GitHub stars~722 tokensUpdated 6 days ago
    Backend & APIsAuto-check passed

More from PostHog/posthog-foss

All 213 skills in this repo
  • Authoring Log Alerts

    PostHog/posthog-foss

    Official

    Author useful, low-noise log alerts on services in a PostHog project.

    721 GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Autoresolving PR Conflicts

    PostHog/posthog-foss

    Official

    Operating procedure for the conflict-autoresolver agent: sweep open PostHog/posthog PRs that conflict with master, resolve the trivial conflicts (generated artifacts deterministically, source…

    721 GitHub stars~4.2k tokensUpdated today
    Auto-check passed
  • Official

    Help users debug PostHog Error Tracking stack-trace symbolication for any supported platform — JavaScript/TypeScript web, React Native (Hermes), Android (Proguard / R8), or iOS / macOS (dSYM).

    721 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Exploring Apm Traces

    PostHog/posthog-foss

    Official

    Investigates distributed application performance using PostHog APM (OpenTelemetry span) data via MCP.

    721 GitHub stars~3.5k tokensUpdated today
    Auto-check passed
  • Exploring LLM Traces

    PostHog/posthog-foss

    Official

    Debug and inspect LLM/AI agent traces using PostHog's MCP tools.

    721 GitHub stars~4.4k tokensUpdated today
    Auto-check passed
  • Investigate Metric

    PostHog/posthog-foss

    Official

    Diagnose why a product metric changed (dropped, spiked, or plateaued) by orchestrating breakdowns, actors, paths, lifecycle, retention, and annotations queries.

    721 GitHub stars~1.9k tokensUpdated today
    Auto-check passed

Works with

Questions about Finding Deleted Feature Flags

What does Finding Deleted Feature Flags do?

Find feature flags that were soft-deleted in the active project within a recent time window. Finding Deleted Feature Flags is an agent skill from PostHog/posthog-foss, published by the product's own GitHub organization. Find feature flags that were soft-deleted in the active project within a recent time window.

When should I use Finding Deleted Feature Flags?

Finding Deleted Feature Flags fits situations like: the user asks what flags were deleted in the last N days; show me recently deleted feature flags; who deleted flag X; audit recent flag deletions.

How do I install Finding Deleted Feature Flags in Claude Code?

Run `npx skills add PostHog/posthog-foss --skill finding-deleted-feature-flags -a claude-code`. Or copy the skill folder (products/feature_flags/skills/finding-deleted-feature-flags in PostHog/posthog-foss) into .claude/skills/finding-deleted-feature-flags in your project. Claude Code loads it when a task matches its description.

How do I install Finding Deleted Feature Flags in Codex?

Run `npx skills add PostHog/posthog-foss --skill finding-deleted-feature-flags -a codex`. Or copy the skill folder (products/feature_flags/skills/finding-deleted-feature-flags in PostHog/posthog-foss) into .agents/skills/finding-deleted-feature-flags in your project. Codex loads it when a task matches its description.

Can I use Finding Deleted Feature Flags in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add PostHog/posthog-foss --skill finding-deleted-feature-flags -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/finding-deleted-feature-flags, .gemini/skills/finding-deleted-feature-flags, .github/skills/finding-deleted-feature-flags and .opencode/skills/finding-deleted-feature-flags in your project.

What does Finding Deleted Feature Flags need to run?

Going by SKILL.md and its folder, Finding Deleted Feature Flags needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python 3.

Does Finding Deleted Feature Flags access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Finding Deleted Feature Flags safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Finding Deleted Feature Flags use?

Finding Deleted Feature Flags is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Finding Deleted Feature Flags use?

About 2k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Finding Deleted Feature Flags?

Skills that share tags, products or a category with Finding Deleted Feature Flags: Analytics (ericrisco/rsc-harness, 156 stars), Almost Paid (nestyme/awesome-prompts, 149 stars), Metabase Prod Query (haacked/dotfiles, 134 stars) and Excel and CSV Data Analysis (bytedance/deer-flow, 83k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Finding Deleted Feature Flags?

PostHog (a GitHub organization, an official publisher) maintains it in PostHog/posthog-foss, which has 721 GitHub stars. The repository holds 213 skills in this directory. The repository was last updated on October 7, 2026.

Source: PostHog/posthog-foss on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.