cleanup

A cleanup command for removing missing or temporary project entries from Gnosys's project registry, a file that records registered project locations.

In plain words
What is it for?
Use it to preview proposed removals with a dry run, review them interactively, or remove them without prompts.
Why use it?
Old entries can remain after a project is deleted or a temporary directory disappears. The command keeps valid projects and targets only dead or temporary entries.

Command

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.

agentmods
npx agentmods add commands/proticom/gnosys/cleanup
Clone the repo
git clone --depth 1 https://github.com/proticom/gnosys
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 479 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.00479
Opus 5 $0.00000 $0.00239
Sonnet 5 $0.00000 $0.00096
Haiku 4.5 $0.00000 $0.00048

Measured 2d ago against content hash f71d5ab57f6e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cleanup scanned grade A with 0 findings 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 2d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/cleanup.md · 82 lines

How it starts

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

gnosys cleanup

Remove dead and temp-dir entries from the project registry (~/.config/gnosys/projects.json).

Usage

gnosys cleanup
gnosys cleanup --dry-run
gnosys cleanup --yes

Options

Option Description
--dry-run Show what would be removed without writing the registry
--yes Non-interactive: remove dead/temp entries without prompting

Classification

Each registered path is classified as:

Category Meaning
alive Directory exists and contains .gnosys/
dead Directory missing, or exists without .gnosys/
temp Path under /tmp, /private/tmp, /var/folders, or the OS temp directory

Only dead and temp entries are candidates for removal. Alive entries are always kept.

Behavior

Interactive (default)

gnosys cleanup

Lists alive, dead, and temp entries, then prompts for confirmation before removing dead/temp paths from the registry.

Dry run

gnosys cleanup --dry-run

Classifies entries and prints JSON with the proposed diff. Does not modify the registry.

Non-interactive

gnosys cleanup --yes

Removes dead/temp entries immediately and prints JSON with the cleanup result.

Output

With --yes or --dry-run, output is JSON including counts of removed and kept entries.

Interactive mode prints a human-readable classification summary before prompting.

Safety notes

  • Cleanup only edits the file registry (projects.json). It does not delete project directories or central DB records.
  • Run gnosys setup sync-projects after cleanup if you want the merged registry rewritten from the central DB.

Validation

cd gnosys-public
npm run cli -- cleanup --help
node scripts/audit-commands.mjs --write
  • gnosys setup sync-projects — refresh registry and agent rules after upgrades.
  • gnosys projects — list registered projects.
  • gnosys init — register a new project.

Read the full file on GitHub · 82 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. 2d ago First seen · 82 lines · 0 tokens per session scan A f71d5ab57f6e

Subscribe to this mod's changes

cleanup is a command published in the GitHub repository proticom/gnosys (4 stars, last pushed 16d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 479 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.