cleanup

cleanup is a command for coding agents from punt-labs/z-spec. It costs 7 tokens per session (588 once invoked), scanned A, a copy of cleanup-dev, MIT.

A cleanup command for removing automatically managed Z specification and TeX build files from a project. Z is a formal notation for describing data, states, and allowed changes.

In plain words
What is it for?
Use it after working with Z specifications to remove files such as fuzz.sty, font files, logs, auxiliary files, and fuzz output from the docs directory.
Why use it?
It keeps generated tools and temporary build files out of the project while preserving the Z source files and compiled PDF documents.

Command

Part of the z-spec-dev plugin — 42 commands, 1 hook shipped together

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/punt-labs/z-spec/cleanup
Clone the repo
git clone --depth 1 https://github.com/punt-labs/z-spec

Or install z-spec-dev, the plugin that ships this one along with the rest of its 42 commands, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cleanup

README.md
[![agentmods](https://agentmods.dev/badge/commands/punt-labs/z-spec/cleanup.svg)](https://agentmods.dev/commands/punt-labs/z-spec/cleanup)
Your own site
<a href="https://agentmods.dev/commands/punt-labs/z-spec/cleanup"><img src="https://agentmods.dev/badge/commands/punt-labs/z-spec/cleanup.svg" alt="Measured on agentmods" height="20"></a>
Per session 7 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 588 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 89% copy Near-identical to another mod 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.00007 $0.00588
Opus 5 $0.00003 $0.00294
Sonnet 5 $0.00001 $0.00118
Haiku 4.5 $0.00001 $0.00059

Measured 5d ago against content hash acfcd789fa8d, 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 5d 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.

Origin

This is a copy

89% identical to cleanup-dev — 2 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

plugin/commands/cleanup.md · 96 lines

What it actually says

Cleanup Z Specification Files

Remove auto-managed TeX tooling files from the project while preserving source specs and PDF output.

Input

Arguments: $ARGUMENTS

  • Directory path (default: docs/)

Files to Remove

TeX tooling (auto-copied by /z-spec:code2model):

  • fuzz.sty - LaTeX style file
  • *.mf - Metafont source files
  • *.pk - Packed font files
  • *.tfm - TeX font metrics

Build intermediates:

  • *.aux - LaTeX auxiliary
  • *.log - LaTeX log
  • *.fuzz - fuzz output
  • *.toc - Table of contents

Files to Keep

  • *.tex - Z specification source files
  • *.pdf - Compiled PDF output

Process

1. Confirm Directory

DOCS_DIR="${1:-docs}"
if [ ! -d "$DOCS_DIR" ]; then
    echo "Directory not found: $DOCS_DIR"
    exit 1
fi

2. List Files to Remove

Before removing, show what will be deleted:

echo "Files to remove from $DOCS_DIR:"
ls -la "$DOCS_DIR"/fuzz.sty "$DOCS_DIR"/*.mf "$DOCS_DIR"/*.pk "$DOCS_DIR"/*.tfm \
       "$DOCS_DIR"/*.aux "$DOCS_DIR"/*.log "$DOCS_DIR"/*.fuzz "$DOCS_DIR"/*.toc 2>/dev/null

3. Remove Files

cd "$DOCS_DIR"

# TeX tooling
rm -f fuzz.sty
rm -f *.mf *.pk *.tfm

# Build intermediates
rm -f *.aux *.log *.fuzz *.toc

4. Report Results

echo ""
echo "Cleanup complete. Remaining files:"
ls -la "$DOCS_DIR"/*.tex "$DOCS_DIR"/*.pdf 2>/dev/null || echo "No .tex or .pdf files"

Output

Report what was removed and what remains:

## Cleanup Complete

Removed from docs/:
- fuzz.sty
- 10 Metafont files (*.mf)
- 3 font files (*.pk, *.tfm)
- 4 build files (*.aux, *.log, *.fuzz, *.toc)

Preserved:
- koch_trainer.tex (source)
- koch_trainer.pdf (output)
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. 5d ago First seen · 96 lines · 7 tokens per session scan A acfcd789fa8d

Subscribe to this mod's changes

cleanup is a command published in the GitHub repository punt-labs/z-spec (5 stars, last pushed yesterday), licensed MIT. It adds 7 tokens to every session and 588 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. It is 89% identical to cleanup-dev, differing in 2 lines, and is treated as a copy.