> For the complete documentation index, see [llms.txt](https://docs.reflag.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.reflag.com/product-handbook/feature-clean-up-and-archival-beta.md).

# Flag clean-up and archival

## Stale flags

After flags have been rolled out to everyone, they turn stale after a set period of time. Stale flags show a broom next to their name. You also receive a Slack notification if that integration is enabled.

<figure><img src="/files/6TLYpGkaoVLJmf7l0PUS" alt=""><figcaption></figcaption></figure>

## Stale flags view

The stale flags view shows all flags that are currently stale and what still needs to happen before they can be archived.

<figure><img src="/files/o4KQCZyvRIpynFKDiUfY" alt=""><figcaption></figcaption></figure>

## Clean-up guide

Open a flag and find the built-in "Clean-up guide". It walks you through the steps required to archive a flag safely.

<figure><img src="/files/fNhUsk7hPGSNQWH8B5Mr" alt="" width="563"><figcaption></figcaption></figure>

There are three **checks** that must pass before the flag is safe to archive:

* Stale: the flag was rolled out to everyone some time ago
* Flag removed from the code in a GitHub repository
* No access checks for some time

There are two **automations** that can be enabled at the flag level:

* Auto-creating a Pull Request once the flag turns stale
* Auto-archiving once all checks pass

See [AI code clean-up](/product-handbook/feature-clean-up-and-archival-beta/ai-code-clean-up-beta.md) for more on automating code clean-up.

## Organization clean-up settings

In organization settings, you control the requirements for each check to pass:

* Configure how soon after rollout flags should be considered stale
* If GitHub is connected, you'll see which repository will be checked for the presence of flags
* How long to wait for the last access check

You can also set the default automation settings for newly created flags.

<figure><img src="/files/V295dau3pg3Tq1aSCOXU" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.reflag.com/product-handbook/feature-clean-up-and-archival-beta.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
