Beta Coming soon. This feature is still being built, so names and details may change before it ships.

Prune stale rules

Rules go stale: a library gets replaced, a folder moves, a rule nobody needs stays in every prompt. Prune finds those rules in .ingot/rules and removes the ones you pick. It always starts as a dry run.

What counts as stale

FindingMeaningSuggested action
unusedno agent used the rule in the last N days (default 90)delete
dead globsits globs match no file in the projectdelete when every glob is dead, otherwise remove the dead globs
deleted pathsit mentions files or folders in backticks that no longer existreview
removed depsit names packages the project no longer depends ondelete when every package is gone, otherwise review

Packages come from a rule's deps: (or requires:) frontmatter list, from imports in its code samples and from backticked @scope/name mentions. Ingot checks them against package.json, requirements.txt, pyproject.toml, go.mod and composer.json.

Review findings are only listed; Ingot never changes those rules for you.

How "unused" is measured

Each agent turn records which .ingot/rules were in its context, in .ingot/.state/rule-hits.json. That folder ignores itself in git, so usage stays on your machine. Prune reports unused only when it has at least N days of usage data, and never for a rule committed less than N days ago. Until then the dialog says how long it has been tracking.

Prune in the IDE

Open the Rules & MCP page, pick the Rules tab and click Prune, or run Prune Stale Rules… from Find Action.

  1. Set Unused for … days.
  2. Read the findings for each rule. Rules with a delete or remove-globs action are checked.
  3. Uncheck anything you want to keep, then click Apply.

Deleted rules are removed from .ingot/rules. When only some globs are dead, the rule stays and its globs keep the live ones. Undo with git checkout -- .ingot/rules.

From the terminal

npx @ingotide/cli rules prune                  # dry run
npx @ingotide/cli rules prune --days 30        # a shorter window
npx @ingotide/cli rules prune --apply          # delete stale rules and drop dead globs
npx @ingotide/cli rules prune --apply --only legacy-api,old-style
OptionMeaning
--days <n>the window for unused (default 90)
--applychange files; without it nothing is written
--only <list>apply to these rules only (names or paths)
--jsonthe findings as JSON