[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-110380":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":15,"stars30d":16,"stars90d":14,"forks30d":14,"starsTrendScore":17,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":10,"pushedAt":36,"updatedAt":37,"readmeContent":38,"aiSummary":39,"trendingCount":14,"starSnapshotCount":14,"syncStatus":13,"lastSyncTime":40,"discoverSource":41},110380,"sdtally","guiselig\u002Fsdtally","guiselig","Explains what makes up macOS System Data by measuring it. Read-only: never deletes, no network. App + CLI for Apple Silicon.","https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Freleases",null,"Rust",110,2,0,33,39,1,61.83,"GNU General Public License v3.0",false,"main",true,[24,25,26,27,28,29,30,31,32,33,34,35],"apfs","apple-silicon","cli","disk-usage","macos","mcp","menu-bar-app","rust","storage","swiftui","system-data","time-machine","2026-11-08 21:52:52","2026-11-20 02:32:08","# SDTally\n\nExplains what makes up **System Data** in macOS Storage settings by measuring it, never estimating. Read-only: it never deletes anything and never moves anything to the Trash. SDTally connects to the internet for one thing only: checking github.com for a new version and downloading it when you click Install. It never sends anything about your disk. Turn off the automatic check in Settings > Versions. The CLI and the root helper never use the network; they ship inside the app and update with it.\n\n[![ci](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Factions\u002Fworkflows\u002Fci.yml)\n[![License: GPL-3.0-or-later](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-GPL--3.0--or--later-blue.svg)](LICENSE)\n[![Latest release](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fv\u002Frelease\u002Fguiselig\u002Fsdtally?include_prereleases&sort=semver)](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Freleases)\n[![Platform: macOS 15+ on Apple Silicon](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplatform-macOS%2015%2B%20%7C%20Apple%20Silicon-lightgrey.svg)](#requirements)\n[![Sponsor](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fsponsors\u002Fguiselig?label=sponsor&logo=githubsponsors)](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fguiselig)\n\nSponsorships go first to the Apple Developer Program (US$ 99 a year), so SDTally can be signed and notarized: no more \"Open Anyway\" on first launch, and a path to Homebrew.\n\nSDTally has two parts that share one measuring engine:\n\n- **`sdtally`**, a command-line tool written in Rust. It does all the measuring and prints text or JSON.\n- **SDTally.app**, a SwiftUI app that runs the embedded `sdtally` and shows the results: a live view, a full measurement, history, recommendations, a menu bar icon and exports.\n\n## Contents\n\n- [Screenshots](#screenshots)\n- [Why System Data is opaque](#why-system-data-is-opaque)\n- [What SDTally measures, and how](#what-sdtally-measures-and-how)\n- [Features](#features)\n- [Requirements](#requirements)\n- [Install](#install)\n- [First run and permissions](#first-run-and-permissions)\n- [Automatic vs Full measurement](#automatic-vs-full-measurement)\n- [CLI usage](#cli-usage)\n- [JSON output, AI agents and MCP](#json-output-ai-agents-and-mcp)\n- [Privacy and safety guarantees](#privacy-and-safety-guarantees)\n- [How it works](#how-it-works)\n- [Languages](#languages)\n- [Limitations and FAQ](#limitations-and-faq)\n- [Building from source](#building-from-source)\n- [Project layout](#project-layout)\n- [Documentation](#documentation)\n- [Contributing, security, license](#contributing-security-license)\n\n## Screenshots\n\n| System Data | Largest folders |\n|---|---|\n| \u003Cimg src=\"docs\u002Fimages\u002Fsystem-data.png\" alt=\"The System Data section: the number from Storage settings broken down into measured parts, each with its source\" width=\"420\"> | \u003Cimg src=\"docs\u002Fimages\u002Flargest-folders.png\" alt=\"The Largest Folders section: a ranking of folders by allocated size, with the app that owns each one\" width=\"420\"> |\n\n| History | Menu bar |\n|---|---|\n| \u003Cimg src=\"docs\u002Fimages\u002Fhistory.png\" alt=\"The History section: a chart of used space and System Data over time, with saved measurements\" width=\"420\"> | \u003Cimg src=\"docs\u002Fimages\u002Fmenu-bar.png\" alt=\"The menu bar icon open, showing free space and a short summary\" width=\"420\"> |\n\n## Why System Data is opaque\n\nSystem Settings > General > Storage sorts files into Applications, Documents, Photos, Music, Developer, macOS and so on. **System Data is not a real category.** It is the remainder: everything the classifier did not assign elsewhere. There is no folder called \"System Data\" on disk, so there is nothing to open and look at. In practice it is mostly `~\u002FLibrary`, plus local snapshots, swap, open-but-deleted files and APFS overhead.\n\nMost cleaners scan a fixed list of known cache folders. That fails in both directions:\n\n- **False positives.** They report space that does not exist (sparse disk images and cloud placeholders look like gigabytes and occupy almost nothing) or remove caches that are still in use.\n- **False negatives.** They miss the real cause when it is not on their list. The audit that started this project found its largest single item to be roughly 19 GB of video files that a code editor's language server had copied into a `bin\u002F` folder. No category-based cleaner would have looked there.\n\nSDTally takes the opposite approach: measure the whole Data volume, explain each measured part in plain language, and show what is left over as \"unexplained\", with the reason it could not be measured.\n\n## What SDTally measures, and how\n\nEvery number comes from a system call, an Apple API, a system log, or exact arithmetic on measured numbers. When the system does not provide a value, SDTally shows \"not measured\" with a reason, never a guess and never a zero.\n\n| What | How it is measured | Why it matters |\n|---|---|---|\n| Used space of the Data volume | `ATTR_VOL_SPACEUSED` via `getattrlist` | The total that has to be explained |\n| Files and folders | Parallel traversal with `getattrlistbulk`, counting **allocated blocks**, not apparent size | A 100 GB sparse VM disk can occupy 2.5 GB |\n| APFS clones | Physical extents (`F_LOG2PHYS_EXT`), so shared blocks are counted once | Deleting one copy of a clone frees little or nothing |\n| Hard links | Deduplicated by (device, inode) | Firmlinks and hard links would otherwise count twice |\n| Cloud placeholders (dataless files) | Detected by flag, never opened, never downloaded | 70 GB of iCloud or OneDrive stubs can occupy 0 bytes |\n| Large extended attributes | `listxattr` | Space that does not show up as file size |\n| Local snapshots | Private size per snapshot via `fsctl`, Time Machine state via `tmutil` and its preferences | Deleted files can stay on disk inside a snapshot |\n| Open-but-deleted files | `lsof` and `proc_pidfdinfo`, per process | Space comes back only when the process closes the file |\n| Protected folders | APFS directory statistics (`dir-stats`) for folders the traversal cannot open | Lets a non-root run still account for them |\n| APFS metadata | IOKit `AppleAPFSUserClient` node counts (a floor) | Volume overhead that is not a file |\n| Purgeable space | CacheDelete, per service | \"Available\" in Settings is free plus purgeable |\n| APFS containers and volumes | `diskutil` and DiskArbitration | The macOS line in Settings is the sum of separate volumes |\n| Swap | `sysctl vm.swapusage` | Lives on the VM volume |\n| The Settings screen itself | The Storage pane's own log lines, read with `log show` | Lets SDTally put its numbers next to Apple's |\n| Trash by age | `ATTR_CMN_ADDEDTIME` (when an item entered the Trash) | Modification date says nothing about when it was trashed |\n| Owning app of a folder | App bundles, container xattrs, app-group entitlements, folder names that match an installed app | \"Whose is this?\" with the evidence named |\n\nThe result is an account that closes: **used = sum of measured terms + unexplained**. The CI checks this invariant on real runs on macOS 15, 26 and 27.\n\nBefore reading anything, `sdtally` turns off two side effects for its own process with `setiopolicy_np`: materializing dataless files (so reading never triggers a cloud download) and access-time updates (so reading never writes metadata). If either call fails, it aborts.\n\nMore detail: [Understanding System Data](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Fwiki\u002FUnderstanding-System-Data) in the wiki.\n\n## Features\n\n### App\n\n| Section | What it shows |\n|---|---|\n| **System Data** | The System Data number from Settings, broken down into what takes the most space, with the source of every number and what is still unexplained |\n| **Disk** | The whole internal disk: containers, volumes (System, Preboot, Recovery, VM, Data), free space, purgeable space, snapshots, swap. After a Full Measurement, also the largest files (sparse and compressed ones marked) and identical copies of large files |\n| **Largest Folders** (sidebar: Paths) | The ranking of the measurement, with the owning app of each folder. Double-click a folder to see its children, and so on |\n| **History** | Used space and System Data over time (hour to year), saved full measurements, \"What Changed Since Last Time\", and the growth pattern of each folder (steady, in spikes, stable, shrinking), with the measured GB per day |\n| **Recommendations** (What to Do) | Advice generated by fixed rules from what was measured. Each item says what it is, whose it is, what is lost if removed, whether macOS cleans it on its own, and the next step. Some items offer \"Copy command\" for a command from a fixed list; the app never runs it |\n\nAlso in the app:\n\n- **Automatic mode** (live, no password) and **Manual** mode (the latest Full Measurement), switched in the header or with ⌘← and ⌘→. See [Automatic vs Full measurement](#automatic-vs-full-measurement).\n- **Passwordless Root**, an optional root helper approved once in Login Items, so full measurements do not ask for the administrator password every time. See [the wiki page](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Fwiki\u002FPasswordless-Root-helper).\n- **Menu bar icon** that can show free space, the amount freed automatically, System Data, used of total, or just the icon. Right-click it and pick **Show in Menu Bar** to switch. The app keeps running in the background with the window closed.\n- **Alerts** when the disk grows 10 GB in a day, when free space drops below a limit you choose in Settings > Behavior (5 to 100 GB, or 10 percent of the disk), and when swap passes a limit (20 GB by default), since a restart gives that space back. Notifications for them are optional.\n- **Folder nicknames.** Folders without a recommendation card show their full path. Right-click one to give it a nickname, show it in Finder or copy its path.\n- **Export JSON** (⌥⌘E) and **Export PDF** (⌘E). The save dialog has \"Replace Personal Names (Recommended for Sharing)\", on by default.\n- **Open at Login**, configurable refresh intervals, and an in-app language picker.\n- **Updates.** The app checks github.com for a new version when it opens and then once a day, and shows it in Settings > Versions. Nothing is downloaded or installed until you click **Install**. Turn off **Check for updates automatically** there to stop the automatic check; the CLI and the root helper never use the network and update with the app. See [Privacy and safety guarantees](#privacy-and-safety-guarantees).\n- **See New Versions** in Settings opens the GitHub Releases page in your browser.\n- **Info** shows the paths of the app, the embedded `sdtally`, the helper and the data folder, plus ready-to-copy commands for AI agents.\n- **Log**: Settings > Advanced > **Open Log** opens it. It records when the app opened and quit, full measurements, updates and errors, in `~\u002FLibrary\u002FLogs\u002FSDTally\u002FSDTally.log`. It stays on your Mac, uses `~` for your home folder and is written in English, so you can attach it to an issue.\n\n### CLI\n\n- The full breakdown of the Data volume, as text or JSON (`sudo sdtally`, `sdtally --json`).\n- A quick reading with no scan (`--quick --json`).\n- Children of any folder by unique allocated size, with \"freed if deleted\" (`sdtally \u003Cpath>`).\n- Raw attributes of one file or folder (`sdtally why \u003Cpath>`).\n- A live tree driven by FSEvents (`--auto`), one JSON line per change.\n- A cross-check against Apple's own commands (`--verify`).\n- Read access to the measurements the app saved (`--last`, `--history`, `--changes`) and an MCP server for AI agents (`--mcp`).\n\n## Requirements\n\n| | |\n|---|---|\n| Mac | Apple Silicon |\n| macOS | 15 (Sequoia) or later. CI runs on macOS 15, 26 and 27 |\n| Account | An administrator account for the full measurement, Passwordless Root and reading the Settings log |\n| Permission | Full Disk Access (for the app, or for your terminal app when using the CLI) |\n\n## Install\n\n### Option 1: download the app\n\n1. Download `SDTally-\u003Cversion>.dmg` from [Releases](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Freleases).\n2. Open the disk image and drag `SDTally` to Applications.\n3. Open it. The app is **not notarized** by Apple, so the first launch is blocked. Open **System Settings > Privacy & Security** and click **Open Anyway**.\n\nThe `sdtally` CLI ships inside the app at `SDTally.app\u002FContents\u002FHelpers\u002Fsdtally`. The app's Info section shows the exact path. To use it from a shell:\n\n```sh\n\"\u002FApplications\u002FSDTally.app\u002FContents\u002FHelpers\u002Fsdtally\" --help\n```\n\n### Option 2: build from source\n\n`cargo build --release` builds the CLI alone; `app\u002Fmontar.sh` builds and signs the whole app. See [Building from source](#building-from-source).\n\n### Uninstall\n\nQuit the app. In Settings, remove Passwordless Root first if you installed it (or use **Measurement > Remove Passwordless Root**). Updates need nothing: there is no separate updater or login item to remove. Then delete `SDTally.app` and, if you want to remove saved measurements, `~\u002FLibrary\u002FApplication Support\u002FSDTally`.\n\n## First run and permissions\n\nOn first launch the app shows a short welcome sheet (also under **SDTally > Welcome and Tips**). Nothing is requested until you click it.\n\n| Permission | What it is for | Without it | Where |\n|---|---|---|---|\n| **Full Disk Access** (required) | Lets SDTally read folders macOS hides even from administrators, such as Mail, Messages and Safari, without macOS asking about each protected folder | The app shows only the steps to grant it and measures nothing until it is granted | System Settings > Privacy & Security > Full Disk Access. The app has an \"Open Privacy & Security\" button and continues on its own once access is on |\n| **Administrator password** | A full measurement as root, so every folder can be opened | Measurement runs without root and is marked incomplete | macOS asks for it each time you choose **Measure with Administrator Password…** (⌘R) |\n| **Passwordless Root** (optional) | Measures as root without asking for the password each time | Each full measurement asks for the password and cannot be stopped midway | Settings > Install… and then approve it once in System Settings > General > Login Items |\n\nFor the CLI, grant Full Disk Access to your terminal app instead; without it the CLI still runs and marks the measurement incomplete.\n\nStep-by-step: [First run and permissions](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Fwiki\u002FFirst-run-and-permissions).\n\n## Automatic vs Full measurement\n\n| | Automatic | Full Measurement (Manual) |\n|---|---|---|\n| Runs | Continuously while the app is open | Once, when you ask (⌘R) |\n| Engine | `sdtally --auto` | `sdtally --json` |\n| Password | None | Administrator password, or none with Passwordless Root |\n| How it stays current | One full pass, then re-reads only the folders FSEvents reports | Point in time |\n| Granularity | Per folder (totals only) | Per file |\n| Largest files | No | Yes (files of 100 MB or more, up to 30) |\n| Protected folders | Not opened (unless \"Automatic with root\" is on) | Opened, as root |\n| Extended attributes | Not measured | Measured |\n| Saved to History | Hourly samples of the largest folders, kept 90 days | Each measurement is saved as a file |\n\nIn Settings > Advanced you can switch Automatic to **With Root**, which needs Passwordless Root. Automatic then reads the whole disk as root and the Automatic | Manual switch disappears. The app explains the trade-offs before you turn it on: a root process keeps running while the app is open, anyone using the session can see the size of other users' folders, and each pass costs more CPU and battery.\n\nDetails: [Automatic vs Full measurement](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Fwiki\u002FAutomatic-vs-Full-measurement).\n\n## CLI usage\n\nGrant Full Disk Access to your terminal app first. `sdtally` writes nothing to disk, not even a cache. Text goes to stdout, progress goes to stderr only when stderr is a terminal.\n\n```sh\nsudo sdtally                        # the full breakdown of the Data volume\nsdtally                             # works without sudo, marked INCOMPLETE with what is missing\nsdtally --top 30 --binary           # 30 ranking lines; GiB instead of decimal GB\nsudo sdtally --json > tally.json    # JSON on stdout (schema below)\nsdtally ~\u002FLibrary --top 10          # children of a folder by unique allocated size\nsdtally ~\u002FLibrary --depth 2         # two levels below\nsdtally why ~\u002F.colima               # raw attributes: allocated, private, clone, flags, xattrs, dir-stats\nsdtally --quick --json              # the Settings screen, used, free, purgeable; no scan\nsdtally --verify                    # compare used, swap and snapshots with df, sysctl and tmutil, now\nsdtally --lang en                   # pt or en; default comes from LC_ALL, LC_MESSAGES or LANG\n```\n\nNotes:\n\n- The System Data line comes from the Storage pane's log, which keeps the value for less than about 21 hours. Open **System Settings > General > Storage**, let it finish loading, then run `sdtally`.\n- Ctrl-C stops the scan and prints the partial report, marked INCOMPLETE (interrupted). The exit code is 130.\n- No color when `NO_COLOR` is set or stdout is not a terminal, unless `--color always`.\n- `sdtally` only measures paths on the Data volume. A path on another volume is refused.\n- Among the largest files, the full measurement marks sparse files (a VM disk that appears as 64 GB but takes 12 GB) and compressed files, with the logical size next to the allocated one.\n- The full measurement also looks for identical copies of large files (100 MB or more): same size, then the first and last MiB, then every byte. Clones and hard links are not counted, cloud-only files are never read, and the comparison stops at 20 GB read or 60 seconds. It only recommends; it never deletes.\n\nA shortened example of the text output (synthetic data from the test suite):\n\n```text\nSystem Settings screen (reproduced)                             GB   source\n  macOS (Σ CapacityInUse − Data)                             39.82   diskutil\n\nData volume                                                 150.00   getattrlist\n  What takes the most space (5 of 5 paths)\n    ~\u002FMusic                                                  38.28   scan\n    ~\u002FLibrary\u002FMobile Documents\u002Fcom~apple~CloudDocs           36.12   scan\n    Local snapshots (8)                                      32.18   fsctl\n    \u002Fprivate\u002Ftmp                                              4.13   scan\n    APFS metadata                                             1.65   IOKit APFS\n  Blocked by macOS                                           19.88\n      difference (13.25% of used; includes what was not measured)\n\nWhy space may not come back (measured only)\n  Local snapshots (8)                                        32.18   fsctl\n    A local snapshot still holds the blocks of files you deleted: the space only\n    comes back when the snapshot is gone.\n```\n\n### Modes\n\n| Command | What it does | Root |\n|---|---|---|\n| `sdtally` | Full breakdown of the Data volume | Recommended (`sudo`); without it the report is INCOMPLETE |\n| `sdtally \u003Cpath>` | Children of a folder by unique allocated size, with \"freed if deleted\" | Not needed |\n| `sdtally why \u003Cpath>` | Raw attributes of a file or folder | Not needed |\n| `sdtally --quick --json` | What changes all the time: Settings screen, used, free, purgeable, containers, swap. No scan | Not needed |\n| `sdtally --quick --json --watch` | Follows the Settings log (`log stream`) and writes one JSON line per new screen, until stdin closes | Not needed |\n| `sdtally --auto` | Live tree: one full pass, then only folders FSEvents reports. One JSON line per change of 10 MB or more, until stdin closes | Optional (the app's helper runs it as root) |\n| `sdtally --last --json` | The newest full measurement saved by the app | Refuses root |\n| `sdtally --history --json` | A summary of every saved full measurement, oldest first | Refuses root |\n| `sdtally --changes --json` | What changed between the two newest saved full measurements (used, System Data, terms and folders that moved 100 MB or more) | Refuses root |\n| `sdtally --mcp` | MCP server over stdio for AI agents | Refuses root |\n| `sdtally --redact names --stdin` | Redacts a measurement JSON read from stdin (up to 20 MB) | Not needed |\n| `sdtally --catalog --json` | The explanation cards and how each data source was checked | Not needed |\n| `sdtally --verify [--json]` | Checks used, swap and snapshots against Apple's commands, now. Exit 0 if nothing is outside, 1 if something is | Refuses root |\n\n### Options\n\n| Option | Meaning | Default |\n|---|---|---|\n| `--top N` | Ranking lines in text output (JSON always has the full ranking) | 15 |\n| `--depth N` | Levels below the path in branch mode | 1 |\n| `--json` | JSON on stdout | off |\n| `--quick` | Quick mode, no scan (requires `--json`) | off |\n| `--since EPOCH_SECONDS` | With `--quick`: read the Settings log only from that moment on, and only while the Storage pane is open | off |\n| `--parts LIST` | With `--quick`: read only `meta`, `volumes`, `swap`, `uso`, `purgeable`, `tela` (comma-separated); other keys are left out | all |\n| `--watch` | With `--quick --json`: follow the Settings log | off |\n| `--binary` | GiB (2^30) instead of GB (10^9) | GB, as in Settings |\n| `--lang pt\\|en` | Language of text output and messages | from `LC_ALL`, `LC_MESSAGES` or `LANG` (`pt*` gives pt, anything else en) |\n| `--color auto\\|always\\|never` | Color | `auto` (only on a terminal and without `NO_COLOR`) |\n| `--redact names\\|off` | Replace the user name and personal folder names in measurement JSON | on only with `--mcp` |\n| `-V`, `--version` | Print the version | |\n| `-h`, `--help` | Print help | |\n\nInvalid combinations exit with code 2 and a message. Full reference: [CLI reference](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Fwiki\u002FCLI-reference).\n\n## JSON output, AI agents and MCP\n\n`sdtally --json` writes one JSON document to stdout (`schema_version: 1`, keys in English). Bytes are integers or `null`, never `0` in place of \"not measured\". Every measured value carries a `state` (`measured`, `partial`, `not_measured`, `not_available`), a `reason` and a `source`. The schema is documented in [docs\u002Fjson-schema.md](docs\u002Fjson-schema.md) (Portuguese) and summarized in English in the wiki: [JSON output](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Fwiki\u002FJSON-output).\n\nFor AI agents, these commands never run as root and never measure as administrator. The full measurement comes from what the app saved.\n\n```sh\nsdtally --quick --json --redact names    # the quick reading, no root\nsdtally --last --json --redact names     # the newest full measurement the app saved\nsdtally --history --json                 # a summary of all saved measurements\nsdtally --changes --json                 # what changed between the two newest\nclaude mcp add sdtally -- sdtally --mcp  # MCP server over stdio\n```\n\nIf you installed only the app, use the embedded binary, for example `\"\u002FApplications\u002FSDTally.app\u002FContents\u002FHelpers\u002Fsdtally\" --mcp`. The app's Info section has these commands ready to copy with the right path.\n\nThe MCP server exposes four tools, without arguments: `quick`, `last_measurement`, `history` and `what_changed`. Over MCP:\n\n- The user name and personal folder names are replaced before anything leaves `sdtally` (`--mcp --redact off` turns this off). Known folders such as `~\u002FLibrary\u002FCaches` and app identifiers stay visible. Numbers are never changed and rows are never merged.\n- Control, bidirectional and invisible characters in strings that come from disk are escaped, and those strings are cut at 256 characters. The fields `path`, `name`, `process`, `creator`, `reason` and `error` hold text from disk and are marked as data, never instructions.\n- Every tool description says: read-only, advice is for the human, never run an advice command without explicit user confirmation.\n- `sdtally` does not use the network, but your AI client does. What you send to an AI goes to its provider. The local history stays unredacted.\n\n## Privacy and safety guarantees\n\nThese are design rules, enforced by tests and CI where possible.\n\n- **Measurement only, no estimates.** Every number comes from a syscall, an API, a log or exact arithmetic on measured numbers. What the system does not report is shown as unexplained or not measured, with the reason.\n- **Recommends, never deletes.** Neither the app nor the CLI deletes, moves to Trash or changes your files. The person executes the recommendation. A test (`tests\u002Fnunca_apaga.rs`) fails the build if production Rust or Swift code contains a delete or trash API, except for an exact, listed count of deletions of SDTally's own files (old saved measurements, the helper's temporary copy of the binary, the replacement of the SDTally app when you install a new version, and that update's temporary folder).\n- **Network.** SDTally connects to the internet for one thing only: checking github.com for a new version and downloading it when you click Install. It never sends anything about your disk. Turn off the automatic check in Settings > Versions. The CLI and the root helper never use the network; they ship inside the app and update with it. What goes out is a request for the latest release (`api.github.com\u002Frepos\u002Fguiselig\u002Fsdtally\u002Freleases\u002Flatest`) with the app's version in the User-Agent, and, after you click Install, the download of the release DMG. Only `https`, only GitHub hosts. A test (`tests\u002Fsem_rede.rs`) and CI fail if networking APIs (`URLSession`, `NWConnection`, `socket(`, `TcpStream`, `UdpSocket` and others) appear anywhere except `app\u002FSources\u002FSDTally\u002FAtualizacao`. \"See New Versions\" only opens a web page in your browser.\n- **Never touches dataless files' contents**, so it never triggers cloud downloads, and never updates access times.\n- **Never recommends** touching `\u002FSystem` or `\u002FLibrary` outside an explicit list, never recommends disabling SIP, and recommends removing Time Machine local snapshots only through Apple's tool (`tmutil`).\n- **Every category shown explains** what it is and what happens if it is removed.\n- **No scareware.** A check (`scripts\u002Fg9.sh`, also in CI and tests) bans words such as \"junk\", \"danger\", \"speed up\" or \"clean now\" in user-facing text, red colors and badges outside narrow exceptions, and toggles in the recommendations screen.\n- **Redaction for sharing.** Exports and AI output can replace the user name and personal folder names. The app's own saved data stays local and unredacted.\n\nFull page: [Privacy and safety](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Fwiki\u002FPrivacy-and-safety).\n\n### Design requirements\n\nEach requirement comes from a real mistake observed in the audit that started the project.\n\n| # | Requirement | Mistake it prevents |\n|---|---|---|\n| 1 | Measure allocated blocks (`stat %b`), never apparent size (`%z`) | Reporting 100 GiB for a sparse disk that occupies 2.5 GiB |\n| 2 | Detect dataless files (cloud placeholders) | Reporting 77 GiB of stubs that occupy 0 |\n| 3 | Check for active sync before calling a cache disposable | Corrupting a chat backup that is uploading to iCloud |\n| 4 | Scan dotfiles in the home folder | Missing `~\u002F.ollama`, `~\u002F.npm`, `~\u002F.colima` |\n| 5 | Explain each item in plain language | \"19 GiB in redhat.java\" is not actionable |\n| 6 | Deduplicate by `(device, inode)` | Firmlinks make `\u002FApplications` count twice |\n| 7 | Treat `Preferences` over 100 MB as an anomaly | Ignoring 4.5 GiB of assets in a folder meant for `.plist` files |\n| 8 | Recognize orphaned trash folders (`CloudStorage\u002F*\u002F.Trash`) | Ignoring gigabytes already discarded that still occupy disk |\n| 9 | Defer to the owning app (Music, Photos, Mail) | Corrupting a library by deleting files underneath it |\n| 10 | Count once per group of APFS clones | Promising space that will not be freed |\n\n## How it works\n\n```text\nSDTally.app (SwiftUI, runs as you)\n  │  runs the embedded Contents\u002FHelpers\u002Fsdtally and reads its JSON:\n  │    --quick --json [--since S] [--parts P]   periodic quick reading\n  │    --quick --json --watch                   follows the Settings log\n  │    --auto                                   Automatic mode (live tree)\n  │    \u003Cpath> --json                            drill-down in Largest Folders\n  │    --redact names --stdin                   redacted exports\n  │    --catalog --json                         explanation cards\n  │\n  ├─ Full Measurement with password:\n  │    osascript \"with administrator privileges\" ──► sdtally --json (root)\n  │\n  └─ Full Measurement \u002F Automatic with Passwordless Root:\n       XPC ──► SDTallyHelper (LaunchDaemon via SMAppService, root)\n                 accepts only the same-team signed app and admin users,\n                 copies sdtally to a root-only folder, verifies its signature,\n                 runs the copy with fixed arguments: --json or --auto\n```\n\n- **`sdtally`** (Rust, `src\u002F`) does all measuring and all arithmetic. The app does not compute numbers; it stores and displays what `sdtally` returned.\n- **The app** (`app\u002FSources\u002FSDTally`) runs the embedded binary and decodes its JSON.\n- **The helper** (`app\u002FSources\u002FSDTallyHelper`) is optional. It runs only `sdtally --json` or `sdtally --auto`, for the user of the XPC connection. Its security model is described in [SECURITY.md](SECURITY.md) and in [the wiki](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Fwiki\u002FPasswordless-Root-helper).\n- **`sdc-coleta`** (`src\u002Fbin\u002Fsdc-coleta.rs`) is a separate research collector that writes an anonymized JSON report. It is not part of the app. Usage (pt-BR): [docs\u002Fsdc-coleta.md](docs\u002Fsdc-coleta.md).\n\n### Where data is stored\n\nEverything the app saves lives in `~\u002FLibrary\u002FApplication Support\u002FSDTally`:\n\n| Path | Contents | Retention |\n|---|---|---|\n| `Medicoes\u002FYYYY-MM-DD-HHMM.json` | The raw stdout of each full measurement (how it ran is kept in an extended attribute, so the file stays identical to stdout) | Up to 100 files or 50 MB; the newest is always kept |\n| `pontos.jsonl` | One point per hour of the quick reading: total, used, free, purgeable, System Data | 400 days |\n| `pastas.jsonl` | Hourly samples of the largest folders from Automatic | 90 days |\n| `auto.json` | The last line of Automatic, so the app opens with numbers while a new pass runs | Overwritten |\n\nThe CLI writes nothing. `--last`, `--history` and `--changes` only read `Medicoes\u002F`, skipping symlinks, files over 20 MB and files with an unexpected schema. **File > Show Saved Measurements in Finder** opens the folder.\n\n## Languages\n\n- **App:** 36 languages (the macOS localizations): Arabic, Catalan, Chinese (Simplified and Traditional), Croatian, Czech, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Malay, Norwegian Bokmål, Polish, Portuguese (Brazil and Portugal), Romanian, Russian, Slovak, Slovenian, Spanish (Spain and Latin America), Swedish, Thai, Turkish, Ukrainian, Vietnamese. By default it follows the system; Settings > Appearance lets you pick one for SDTally only (applies after reopening). Right-to-left languages are supported.\n- **CLI text output and messages:** Portuguese (Brazil) and English (`--lang`).\n- **JSON:** keys and `advice[].text` in English. Explanation cards and \"why space may not come back\" texts carry translations into the same 36 languages.\n\n## Limitations and FAQ\n\n**Why are the numbers different from Finder or Settings?** Finder and Settings show apparent sizes and decimal GB. SDTally counts allocated blocks, counts a shared clone block once, and shows a dataless placeholder as 0 on disk. Settings also subtracts things it considers purgeable. SDTally puts Apple's number next to its own and labels the source of each.\n\n**I deleted something and the space did not come back.** Common measured causes: a local snapshot still holds the blocks, an app still has the deleted file open, the file was an APFS clone sharing blocks with another file, it was a cloud-only placeholder, or it went to the Trash. The \"Why space may not come back\" block lists only the causes that were measured at 1 GB or more.\n\n**The System Data line says \"no record\".** The number only exists in the Storage pane's log, which keeps it for less than about 21 hours. Open System Settings > General > Storage, wait for it to finish loading, and run again. The app can also open System Settings out of sight to refresh it (every 10 minutes while the app is open by default; see Settings > Automatic Refresh).\n\n**Why is there an \"unexplained\", \"Blocked by macOS\" or \"Not measured\" line?** It is used space minus everything measured, and it never goes negative (if parts overlap, it becomes \"not measured\" with the overlap reported). Without root or Full Disk Access the app calls it \"Blocked by macOS\": most of it is folders macOS would not let SDTally read, and measuring with the password reduces it. With both, the app calls it \"Not measured\": what remains is folders protected even from administrators and changes during the measurement, and no permission reduces it.\n\n**Why is the app not notarized?** Notarization requires a paid Apple Developer membership. The app is signed with an Apple Development certificate. Use \"Open Anyway\" once, or build it yourself.\n\n**Does it work on Intel Macs or macOS 14?** No. Apple Silicon and macOS 15 or later only.\n\n**Can I use it on an external disk?** No. SDTally measures the boot Data volume. External Trash folders (`\u002FVolumes\u002F*\u002F.Trashes`) are not scanned.\n\n**Does SDTally use the internet?** For one thing only: checking github.com for a new version and downloading it when you click Install. It never sends anything about your disk. The app checks when it opens and then once a day; turn this off in Settings > Versions (you can still check by hand there). The CLI and the root helper never use the network; they ship inside the app and update with it.\n\n**How does an update install?** Only when you click **Install** in Settings > Versions. The app downloads the DMG of the latest release, checks it against the SHA-256 that GitHub publishes for an immutable release, opens it read-only, and checks that the new app is signed by the same developer (identifier and Team ID) and is newer. Then it quits through the usual path: if a full measurement is running, it asks first, and **Keep Measuring** cancels the update. A small helper inside the app (`Contents\u002FHelpers\u002FSDTallyUpdater`, no network) waits for the app to quit, checks the signature again, replaces `SDTally.app` and opens the new version. If anything fails, the installed version stays as it was and opens again with the reason in Settings.\n\n**Will it clean my Mac?** No. It explains and recommends. You decide and act, in Finder or in the owning app.\n\nMore: [FAQ](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Fwiki\u002FFAQ).\n\n## Building from source\n\nRequirements: Apple Silicon, macOS 15+, Rust stable (edition 2024), and Xcode 27 for the app (older Xcode versions fail to compile it; the built app runs on macOS 15+).\n\n```sh\n# CLI\ncargo build --release                 # binaries: target\u002Frelease\u002Fsdtally and sdc-coleta\ncargo test --release                  # unit tests, a 100,000-buffer parser test, APFS fixture (hdiutil, no root)\ncargo clippy --release --all-targets -- -D warnings\n\n# App\nswift test --package-path app         # app tests with synthetic fixtures\napp\u002Fmontar.sh                         # builds sdtally, the app and the helper, assembles and signs SDTally.app\napp\u002Fmontar.sh --abrir                 # same, then opens it\n\n# Anti-scareware check (also run by CI)\nsh scripts\u002Fg9.sh\n```\n\n`app\u002Fmontar.sh` writes the app to `~\u002FLibrary\u002FCaches\u002Fsdtally-build\u002FSDTally.app` (override with `SDTALLY_BUILD`). It signs with the first **Apple Development** identity in your keychain; a free Personal Team certificate works (Xcode > Settings > Accounts > Manage Certificates > + > Apple Development). Set `SDTALLY_ASSINATURA` to pick a specific identity. Without any identity it signs ad hoc: the app runs, but **Passwordless Root cannot register** and Full Disk Access is lost on every rebuild.\n\nIf the repository lives in iCloud Drive, set `CARGO_TARGET_DIR` outside it so `target\u002F` is not synced.\n\nDetails: [Building from source](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Fwiki\u002FBuilding-from-source).\n\n## Project layout\n\n| Path | Contents |\n|---|---|\n| `src\u002F` | The Rust library and engine: traversal (`walk\u002F`), data sources (`sources\u002F`), system bindings (`sys\u002F`), report and text output (`report\u002F`), advice rules (`conselho.rs`), explanation cards (`catalogo.rs`), redaction (`redigir.rs`), MCP (`mcp.rs`), translations (`traducoes\u002F`) |\n| `src\u002Fbin\u002Fsdtally.rs` | The CLI entry point and argument parsing |\n| `src\u002Fbin\u002Fsdc-coleta.rs` | Research collector (anonymized report) |\n| `tests\u002F` | Rust integration tests, fixtures and golden text output |\n| `app\u002FSources\u002FSDTally\u002F` | The SwiftUI app and `Localizable.xcstrings`. `Atualizacao\u002F` is the only network code (update check and download) |\n| `app\u002FSources\u002FSDTallyInstalacao\u002F` | Installing an update, no network: version, signature, DMG, bundle replacement |\n| `app\u002FSources\u002FSDTallyUpdater\u002F` | The update executor (`Contents\u002FHelpers\u002FSDTallyUpdater`), no network: replaces the app after it quits |\n| `app\u002FSources\u002FSDTallyHelper\u002F` | The root helper (LaunchDaemon) |\n| `app\u002FSources\u002FSDTallyXPC\u002F` | The app–helper XPC contract and signing requirement |\n| `app\u002FTests\u002F` | App tests and synthetic fixtures |\n| `app\u002Fmontar.sh` | Builds and signs `SDTally.app` |\n| `scripts\u002F` | `g9.sh` with `g9-proibidas.txt` and `g9-excecoes.txt` (anti-scareware check), `publicar.sh` (release), `termos-macos.py` (looks up how macOS translates UI terms, for translators) |\n| `scripts\u002Fdmg\u002F` | DMG background and window layout used by `publicar.sh` |\n| `docs\u002F` | Storage model, measurement pitfalls, platform restrictions, target catalog, JSON schema (Portuguese) |\n| `research\u002Fmapa-de-fontes.md` | Where Apple takes each number from; the app shows it as a source (Portuguese) |\n\nComments and identifiers in the code are in Portuguese.\n\n## Documentation\n\n- Wiki: [Home](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Fwiki) · [Installation](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Fwiki\u002FInstallation) · [CLI reference](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Fwiki\u002FCLI-reference) · [JSON output](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Fwiki\u002FJSON-output) · [Understanding System Data](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Fwiki\u002FUnderstanding-System-Data) · [FAQ](https:\u002F\u002Fgithub.com\u002Fguiselig\u002Fsdtally\u002Fwiki\u002FFAQ)\n- In the repository (Portuguese): [storage model](docs\u002F01-modelo-de-armazenamento.md), [measurement pitfalls](docs\u002F02-armadilhas-de-medicao.md), [platform restrictions](docs\u002F03-restricoes-de-plataforma.md), [target catalog](docs\u002F04-catalogo-de-alvos.md), [JSON schema](docs\u002Fjson-schema.md), [source map](research\u002Fmapa-de-fontes.md).\n\n## Contributing, security, license\n\n- Contributing: [CONTRIBUTING.md](CONTRIBUTING.md)\n- Security issues: [SECURITY.md](SECURITY.md). Please report privately, not in public issues.\n- License: [GPL-3.0-or-later](LICENSE). Copyright (C) 2026 Guilherme Selig. You may use, study, modify and redistribute it; if you distribute a modified version, you must publish its source under the same license.\n","SDTally 是一款专为 Apple Silicon Mac 设计的 macOS 系统数据深度分析工具，用于精确测量而非估算‘系统数据’（System Data）的实际组成。它通过直接扫描 APFS 卷元数据与文件系统结构，识别缓存、日志、Time Machine 本地快照、Spotlight 索引等隐藏占用项，并提供 CLI 命令行工具（Rust 实现）与图形化 SwiftUI 应用双形态。所有操作均为只读，不删除、不移动文件，网络访问仅限版本检查且可禁用。适用于 macOS 存储空间异常占用排查、系统维护优化及开发者对磁盘使用构成的精细化诊断。","2026-11-24 04:38:49","CREATED_QUERY"]