Skip to Content

Using purgeit with AI agents

How agents (and the people supervising them) can use purgeit safely.

purgeit is designed to be driven by an agent: every command has structured output, deletions are re-verified, and guidance ships with the CLI.

Get the guide

purgeit skill

Prints a guide versioned with the installed CLI, so it always matches the commands that exist. The package also ships a SKILL.md stub for agent-skill installers.

This site is agent-friendly too:

  • Append .md to any docs URL, or send Accept: text/markdown, to get the page as Markdown.
  • /llms.txt lists every page; /llms-full.txt is the whole site in one file.

The workflow an agent should follow

Look first. purgeit scan <dirs> --format json lists candidates and deletes nothing. The report has a projects[] rollup (dormant projects first) as well as every entry. Narrow with --stale, --min-size, --min-age, --only.

Show the user the projects and the total — not hundreds of paths. Entries with a non-null protection are never deleted; purgeit explain <path> --format json tells you why anything is matched, skipped or protected.

Delete only what was approved. Trim the report to the approved entries and run purgeit clean --plan plan.json --yes. Use --dry-run to preview.

Keep the 7-day guard

Don't lower --min-age below its default (7d) unless the user asks. It is the guard against deleting something a person is working on.

Why this is safe to hand to an agent

  • Every path is re-verified at deletion time against the rules, git, deploy keys and recent activity, so a stale or edited plan cannot delete the wrong thing. See the safety model.
  • Nothing is deleted without --yes (or an interactive confirmation), and without a terminal clean refuses to guess.
  • Output is stable JSON with documented exit codes and formats. With --format json, even errors are JSON on stdout ({"error":{"code","message"}}), so a parser never has to scrape stderr.
  • Everything deleted is recorded: purgeit history --format json.

Other useful commands

CommandUse
purgeit rules --format jsonWhat is matched, and the proof gated rules need
purgeit history --format jsonWhat has been deleted
purgeit scan --format ndjsonStream results as they are measured
purgeit explain <path> --format jsonWhy a directory is matched, skipped or protected, and what clean would do

On this page