Logo Macos Storage Management

Macos Storage Management

Cộng đồng
AtlasOmnia
macos-storage-management

macos-storage-management — Use when freeing Mac storage or moving files to SSDs.

Add to TypingMind

Tổng quan

Nhà phát hànhAtlasOmnia
Kho mãdonna-starter
Tên kỹ năngmacos-storage-management
Sao
131
Bản fork
9
Tệp đi kèm
2
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 2 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được AtlasOmnia công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Macos Storage Management trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/AtlasOmnia/donna-starter/tree/main/skills/apple/macos-storage-management
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AtlasOmnia/donna-starter.git /tmp/donna-starter
mkdir -p .claude/skills
cp -r /tmp/donna-starter/skills/apple/macos-storage-management .claude/skills/macos-storage-management
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Macos Storage Management trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Macos Storage Management ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Macos Storage Management với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

macOS Storage Management

Safely reclaim local Mac storage without mistaking cloud placeholders for resident data, losing File Provider content, or flattening metadata onto an incompatible external filesystem.

Trigger

Load this skill when the user asks to free space on a Mac, move Documents/Desktop/Downloads to an external SSD, archive iCloud/File Provider folders, migrate between APFS and ExFAT, or explain conflicting Finder, du, and df storage figures.

Safety Principles

  1. Measure the live Data volume, not only /. On modern macOS, use df -h "$HOME" because /System/Volumes/Data carries user data.
  2. Inspect the destination filesystem before choosing a copy method. ExFAT does not preserve native macOS symlinks, ownership, permissions, extended attributes, resource forks, or every filename semantic.
  3. Treat File Provider folders specially. A logical file can be dataless with zero allocated blocks. Its apparent size is not reclaimable local space until downloaded.
  4. Never delete on a partial copy. Copy/archive, independently verify, re-check source identity/state, then remove only verified source objects.
  5. Do not force cloud hydration onto a critically full disk. If placeholders materially exceed free space, move only resident files or free space elsewhere first.
  6. Report actual reclaimed capacity. Compare df before/after; do not equate logical file size with local blocks released.

Diagnosing an oversized “System Data” category

Treat the Storage Settings number as a classification clue, not a filesystem path. Before recommending cleanup:

  1. Compare the sealed System volume with the writable Data volume using diskutil apfs list and df -h "$HOME".
  2. Check both Time Machine and APFS snapshots; do not assume snapshots are responsible.
  3. Rank $HOME, ~/Library, /private/var, /Library, and hidden application roots with allocated-block measurements.
  4. Drill into app containers, group containers, caches, developer runtimes, cloud storage, and /private/var/folders.
  5. Inspect large files stored directly at a root such as ~/.hermes; directory-only rankings can hide backup multiplication.
  6. Separate rebuildable caches/temp data from app-managed stores and live databases before proposing deletion.

Workflow

1. Establish scope and capacity

  • Confirm the user-authorized source and mounted external destination.
  • Run df -h "$HOME" /Volumes/* and du -sh "$HOME/Documents" (or the requested tree).
  • Rank top-level source items with du -sh.
  • Inspect the external volume with diskutil info for filesystem, read-only state, and free capacity.
  • Check whether the intended destination path already exists before writing.

2. Detect File Provider and placeholder state

Check source directory extended attributes and representative files:

bash
ls -ldO@ "$SOURCE"
ls -lO@ "$FILE"
stat -f 'flags=%Sf size=%z blocks=%b fileid=%i' "$FILE"

Important signals:

  • com.apple.file-provider-domain-id on the folder;
  • dataless in file flags;
  • blocks=0 with nonzero logical size;
  • Resource deadlock avoided while a copy/archive tool tries to open cloud-only data.

Inventory resident regular files without opening placeholders: use lstat, require regular-file mode, and select st_blocks > 0. Count resident allocated bytes as st_blocks * 512. Separately count zero-block/dataless logical bytes and symlinks.

3. Select a transfer strategy

APFS destination

A direct metadata-preserving copy may be appropriate. Still verify before source removal. For a newly formatted external SSD intended to hold live Git repositories, first run a sustained multi-gigabyte write → sync → destination SHA-256 readback gate; a successful format, mount, SMART result, or diskutil verifyVolume does not prove the USB cable/port/power path is stable under load. Restore cold Git archives through hidden same-volume staging, repair linked-worktree metadata only after verifying the common repository has no writer, and keep source archives intact until Git acceptance passes.

ExFAT destination
  • For ordinary files with portable names, copy into a structured destination and verify hashes.
  • For macOS-heavy trees containing symlinks, app bundles, aliases, resource forks, or metadata, use an archive on ExFAT rather than pretending a direct folder copy is equivalent.
  • If File Provider placeholders are present and cannot be hydrated safely, archive resident regular files only and leave placeholders untouched.
  • For flat files without macOS metadata significance (databases, archives, logs), hash-verify the destination against the source before removing anything, and run these transfers as background execution — they are often large.

4. Classify application data before moving it

A large application directory is rarely one safe unit. Split candidates into:

  1. Movable inactive archives: dated backups, pre-update snapshots, legacy checkpoints, and completed export bundles.
  2. Rebuildable cleanup: caches, temporary build trees, DerivedData, and unused simulators—normally delete rather than move.
  3. App-managed storage: Docker disks, OneDrive local availability, Photos libraries, Voice Memos, Notes databases—use the owning application's migration or cleanup controls.
  4. Live state: current profiles, session databases, memory stores, logs, active worktrees, and open project checkouts—do not generically relocate.

Before moving an inactive archive, record its size and modification time, check exact destination-name collisions, and verify no process has an open file beneath the source. A dated name is evidence, not proof of inactivity.

For macOS-heavy archive trees on ExFAT, create one uncompressed PAX tar plus a companion manifest per source. Process sources sequentially so each verified tree is an independent commit point and a later failure cannot compromise earlier or untouched sources.

Inactive Git repositories and worktrees

Treat Git checkouts as macOS-heavy preservation trees, not ordinary portable folders. Before archiving, discover nested repositories/worktrees; record branch and HEAD; require clean status unless the user explicitly approves a dirty-state archive; inspect both exact-path open files and process command lines for incumbent writers, watchers, test runners, or controller scripts; and exclude current canonical checkouts. A dated or final name is not enough by itself.

On ExFAT, archive each bounded source as its own uncompressed PAX tar rather than moving the checkout directly. Verify every intended regular-file hash and symlink target against a source manifest, re-check the complete source identity and Git cleanliness immediately before deletion, then finalize the tar and companion manifest atomically. Report intentionally excluded active or dirty trees at closure.

Resource-bounded batched moves to an external SSD

When the user explicitly wants data moved, preserve that objective. Classify candidates first, but do not substitute deletion or a cloud-only toggle unless moving has a concrete safety or compatibility blocker.

On a critically full Mac, process eligible archives sequentially or in explicit size-limited batches. Copy directly to a destination .partial, hash-verify it, re-check source identity, atomically finalize, persist one manifest record, and only then remove that source file. Do not create a second large staging artifact on the Mac. Use one exact selector for inventory, open-file checks, transfer, and closure so sidecars do not inflate counts or make totals disagree.

Long bounded transfers should run as tracked background work with completion notification. Persist the manifest after every committed file, and reconcile source, destination, manifest, and stale .partial files before resuming after interruption.

Temporary builds and cache cleanup

Treat /private/tmp as mixed-risk, not automatically disposable. Before selecting completed build trees, check open files, process current-working-directories, and recent modification times. If provenance is uncertain, archive only quiet top-level trees to the SSD with the same fail-closed manifest/hash sequence used for inactive backups.

For rebuildable caches, use an explicit target allowlist and one lsof -Fn snapshot. Skip any target with an open file rather than terminating applications just to reclaim space. Measure cleanup candidates and results using allocated blocks (st_blocks * 512). Never generically clear CloudKit, cloud-provider stores, browser profiles, application databases, Docker disks, or live Hermes state.

Large dependency trees may contain hundreds of thousands of tiny files. Emit entry-count progress during inventory and verification, and expect the job to be metadata-bound even when total bytes are modest. See scripts/cleanup-inactive-caches.py.

Docker Desktop sparse-disk diagnosis and cleanup

Docker Desktop normally concentrates its Mac-side storage in ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw. Treat this as an app-managed sparse disk:

  1. Compare logical capacity (st_size) with physical allocation (st_blocks * 512). The logical value may be hundreds of GiB without consuming that much Mac storage.
  2. With Docker running and authorized, attribute internal usage using docker system df -v, docker compose ls -a, docker ps -a, docker volume ls, and docker buildx du.
  3. Before removing a Compose project, inspect container labels, compose working/config paths, bind mounts, named versus anonymous volumes, networks, and image references. Preserve images shared by unrelated running services.
  4. Treat containers, images, Docker-managed volumes, project networks, build cache, and ordinary host folders as separate deletion scopes. A Docker-context removal defaults to Docker artifacts only; do not infer permission to delete similarly named host folders.
  5. Remove an explicitly retired project in dependency-safe order: containers with attached anonymous volumes, owned named volumes, project network, exclusive images, then eligible build cache.
  6. Preserve generic dependency images such as PostgreSQL, MySQL, language runtimes, and search services until both container ancestry and compose-file references have been checked. A stopped test container can be the only remaining owner of a multi-gigabyte runtime image.
  7. Never use docker system prune --volumes as a blind shortcut on a machine with unrelated services, and never manually delete Docker.raw unless the user explicitly intends a complete Docker reset.
  8. Verify by readback rather than exit status alone: confirm target containers/images/volumes/networks are absent, unrelated services remain healthy, Docker.raw allocated blocks declined, and df -h "$HOME" shows actual reclaimed Mac capacity. Docker deletion is not complete merely because internal objects disappeared.

Cloud sync versus cloud backup

When a user asks whether cloud storage should replace an unstable external SSD, separate three roles before recommending a provider:

  1. Active workspace: high-I/O Git worktrees, databases, Docker disks, simulators, build trees, and virtual machines stay on a known-good local APFS volume. Do not place them inside Google Drive, OneDrive, iCloud Drive, Dropbox, or another file-provider sync root.
  2. Cloud Git host: GitHub or GitLab can preserve committed source, branches, issues, reviews, and releases, but a remote Git repository does not contain uncommitted, untracked, ignored, or machine-managed state. Use Git LFS or release assets only for bounded binaries; do not turn Git history into a whole-drive backup.
  3. Off-site archive/backup: Google Drive, OneDrive, iCloud Drive, Backblaze B2, R2, or a dedicated backup application can hold dated archives and large assets. A sync folder is not automatically an independent backup: deletions and corruption can propagate to every device.

For Apple-centric personal data, an existing iCloud Drive quota is a practical archive destination, especially for dated encrypted archives, exports, installers, and documents. Treat Optimize Mac Storage and cloud-only placeholders as expected File Provider behavior, not as proof that a local working copy exists. Apple iCloud Drive deletion propagates across connected devices; retain separate date-stamped snapshots and verify each upload with an independent download/readback before retiring local data. Keep employer/business data in its authorized tenant (for example, the employer's OneDrive) rather than mixing it into a personal iCloud account.

When the source disk is failing under load, first preserve the source and copy critical data to a qualified local destination. Then create a layered layout: healthy local active copy, cloud Git remote for committed source, and dated cloud archive for non-Git data. Qualify the replacement SSD with a sustained multi-gigabyte write, sync, and cryptographic readback before treating it as the active workspace; a SMART pass or successful mount alone does not prove the USB cable, port, enclosure, power, or thermal path is stable.

5. Fail closed

Use a temporary destination name such as .partial. The operation must follow this order:

  1. enumerate eligible source files;
  2. record source path, size, mtime, inode, and a content hash;
  3. write archive/copy to the external disk;
  4. test archive structure/CRC;
  5. independently read destination content and compare cryptographic hashes;
  6. atomically rename the verified temporary artifact to its final name;
  7. re-check each source object's size, mtime, and inode;
  8. remove only those verified, unchanged source files;
  9. remove empty directories only when truly empty;
  10. sync and measure reclaimed local capacity.

Any read, copy, verification, or source-identity failure must preserve the source.

6. Verify and close out

Report the exact destination path, resident files and allocated bytes moved, verification result, source objects removed, cloud placeholders retained, source size before/after, Mac free space before/after, and whether remaining free space is still operationally low.

Start completion answers with Yes or No. Separate completed work from remaining storage risk.

Common Pitfalls

du versus df

du can show figures that do not explain APFS snapshots, purgeable data, File Provider state, or Data-volume pressure. Use both; df "$HOME" is the closure metric.

Interruptions during large external-drive transfers

Do not size a foreground tool timeout from the byte count and hope it is sufficient; USB speed, filesystem overhead, hashing, and metadata vary. Run long bounded transfers as tracked background work with completion notification. Resume from per-file durable commits, not from process exit status. Before restarting, reconcile any final destination file or .partial with the source and manifest; apparent size alone is not proof of a completed copy — hash-verify the destination against the source before removing anything.

Blind mv across filesystems

A cross-volume mv is copy-then-delete. It can fail halfway and does not solve ExFAT metadata incompatibility. Never use it as the unverified safety mechanism for mixed macOS trees.

Treating unzip -t as full proof

CRC validation proves archive readability, not necessarily that every intended resident source was included. Compare the archive entry set and cryptographic hashes against an explicit source manifest.

Retrying ditto after placeholder errors

Resource deadlock avoided in a File Provider tree is a diagnostic signal, not a reason to keep retrying the same bulk copy. Inspect dataless flags and allocated blocks, remove any failed partial artifact only after a separate verified transfer exists, then use a resident-only strategy.

Deleting cloud placeholders to reclaim space

Dataless placeholders usually consume negligible local data blocks; deleting them may remove cloud originals while reclaiming little space. Leave them untouched unless the user explicitly wants cloud deletion.

Supporting Material

  • See scripts/archive-resident-files.py for a generic fail-closed resident-file archiver with SHA-256 destination verification.
  • See scripts/cleanup-inactive-caches.py for a dry-run-first cache cleaner that skips targets with open files.

Public support files

  • scripts/archive-resident-files.py
  • scripts/cleanup-inactive-caches.py

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Macos Storage Management làm được gì?

macos-storage-management — Use when freeing Mac storage or moving files to SSDs.

Vì sao nên dùng Macos Storage Management trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Macos Storage Management là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Macos Storage Management trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/AtlasOmnia/donna-starter/tree/main/skills/apple/macos-storage-management. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Macos Storage Management?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Macos Storage Management với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Macos Storage Management với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Macos Storage Management có miễn phí không?

Có. Kỹ năng này được AtlasOmnia phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇