# Disk Census documentation

> How to use census, the Disk Census engine as a command, from your terminal, your scripts and your AI agents.

## Command line

Every census command, its options and its JSON, for your terminal and your scripts.

- [The census command line](https://diskcensus.com/docs/cli.md): census is the Disk Census engine as a command. It runs the app's scan, findings and cleanup from your terminal, your scripts and your AI agents.
- [Quickstart](https://diskcensus.com/docs/cli/quickstart.md): Scan your Mac, see what is using the space, clean what is safe and review the rest, in five steps.
- [Scans and scopes](https://diskcensus.com/docs/cli/scans.md): What census scans, how to choose a scope, where the saved scan lives, and how queries reuse it.
- [Safety and deletion](https://diskcensus.com/docs/cli/safety.md): What census reads, what it can delete, how it asks, and the checks every item passes before it is deleted.
- [JSON output](https://diskcensus.com/docs/cli/json.md): Every command's --json output is one envelope on stdout, with the same fields for every command. Read it from scripts, and follow long jobs with progress events.
- [Exit codes and errors](https://diskcensus.com/docs/cli/errors.md): What each census exit code means, every error code it can report, and what to do about each one.
- [Seeing what uses space](https://diskcensus.com/docs/cli/explore.md): Scan a scope, then ask the saved scan where the space went, by folder, file, bucket, file type and over time.
- [Finding what to remove](https://diskcensus.com/docs/cli/find.md): Find cleanup candidates, large and forgotten files, duplicate copies, and apps with their leftovers. Every command here only reads.
- [Cleaning up](https://diskcensus.com/docs/cli/clean.md): Delete the safe tier, choose from what needs review, delete exact paths from a selection file, empty the Trash, and uninstall apps.
- [Maintenance](https://diskcensus.com/docs/cli/maintain.md): List and run the maintenance tasks, such as rebuilding Quick Look's cache or deleting local snapshots, and optimize the Mac in one step.
- [Reports and exports](https://diskcensus.com/docs/cli/export.md): Save a scan as JSON, Markdown, a self-contained HTML page or CSV, with home-folder names hidden when you share it.
- [Utilities](https://diskcensus.com/docs/cli/utilities.md): Command syntax and help, Full Disk Access checks, versions, the self-test, and census serve.

## AI agents

How Claude Code, Codex, Cursor and other agents free space with census, and only with your approval.

- [Census for AI agents](https://diskcensus.com/docs/agents.md): Let your AI coding agent free disk space with census. It reads freely, deletes only what you approve, and the engine enforces the limits even if the agent gets it wrong.
- [Setup](https://diskcensus.com/docs/agents/setup.md): Turn on census for your AI agents in the Disk Census app, check that your agent can run it, and give it the access it needs.
- [The workflow](https://diskcensus.com/docs/agents/workflow.md): Each request an agent handles with census, step by step: the commands it runs, what it shows the person, and when it must ask.
- [Rules for agents](https://diskcensus.com/docs/agents/rules.md): The rules an AI agent follows when it frees disk space with census. Written for the agent to read, and complete on its own.
- [Cleaning agent data](https://diskcensus.com/docs/agents/agent-data.md): What census finds in the folders AI coding agents use, what it deletes, and what it never touches, agent by agent.
- [census serve](https://diskcensus.com/docs/agents/serve.md): Talk to the census engine from your own program, one JSON request per line on stdin. The Disk Census app uses the same protocol.
