danwright32

disk-full

Use when the Mac is out of disk space or close to it, when Bash calls start failing with ENOSPC or "cannot create temp file", when a hook fails for no apparent reason and the disk is suspect, or when the low free space warning fires. Holds the measured triage sequence, read only apart from two clearing commands that run on Dan's decision (one, the Xcode build cache sweep, he has let the low space warning run on its own), the low space check removing its own copies of a warning's readings after 14 days, and removals Dan decides on, made through disk-remove.sh, in the order that finds the cause fastest.

danwright32 0 Updated 4d ago

Resources

1
GitHub

Install

npx skillscat add danwright32/claude-config/disk-full

Install via the SkillsCat registry.

SKILL.md

disk-full

A full disk is the one state where the tool that would diagnose it cannot run. On 2026-09-10 the
boot volume hit zero, and the first sign inside Claude Code was hooks/check-project-list.sh
failing with cannot create temp file for here document, followed by every Bash call failing with
ENOSPC before it could run. Reaching the actual cause took about forty minutes, most of it
rediscovering the sequence below. It is written down so it does not have to be found again.

On 2026-10-04 the disk fell from 25 GB to 8 GB free more than once while several Overture agent
sessions built and crash tested. Neither the low space warning, nor this sequence, nor Overture's
DerivedData reclaim could see why, because the cause is a root only folder that no command here
could read: /System/Library/Caches/com.apple.coresymbolicationd, macOS's symbol cache, at 194 GB.
Dan's cleaner app found it. That is step 7.

Before anything else

If Bash itself cannot write its output file, no command here will run. Ask Dan to type the
command himself with the ! prefix, which runs it in the session and puts the output straight into
the conversation. Say that plainly rather than retrying a command that cannot work.

Free space first, and never guess a cause from a single number. A static size says the disk is
full. It does not say what is filling it, and the difference decides what to do: something still
writing needs stopping, while something that already wrote needs deleting. Take two readings.

The sequence

1. How much is left, and on which volume

df -h /System/Volumes/Data /

/System/Volumes/Data is where a Mac's home directory actually lives. / is the read only system
snapshot and reports headroom that has nothing to do with anybody's files, so a reading taken from
/ alone can look healthy while the disk is full.

2. Whether it is still falling, and how fast

Two readings, ten or more minutes apart, never one. A rate is the whole diagnosis: 19 GB an hour
is something actively staging files, and no amount of deleting will keep up with it until it is
stopped.

The session's low space warning already takes a reading on every prompt and keeps the last six
hours of them, so ask it rather than measuring a second way:

bash ~/.claude/hooks/check-free-space.sh --report; echo "exit $?"

It adds a reading to that history and says how much is left, then either the rate and how long
until zero, or why it states no rate yet (the first reading, readings too close together, a fall
that has not yet lasted 30 minutes, free space having gone back up, or not falling at all). It
projects only space that has stayed gone for 30 minutes, because a build or pre push check takes a
few GB and gives it back within minutes (#1754), and after free space goes back up it measures from
the level the rise held for 30 minutes, so a short spike up is never read as a fall (#3153). A rise
is not counted as going back up at all when free space falls to the level it rose from, or lower,
within 30 minutes, so a fall broken by small give backs is still projected across them (#3636). A fast
fall stands down once the last 30 minutes on their own would not reach zero within six hours, and
says when it stopped and how much went, so a drop that happened once and stopped is not projected
for the rest of the six hours (#3608). Judge it by the exit code, not the wording:
0 means there is room and no fall reaching zero within six hours was measured (with no rate stated, nothing about the trend was measured yet), 3 under the floor (FREE_SPACE_FLOOR_GB, 20 GiB, which the warning writes in decimal units as 21.5 GB), 4 falling fast
enough to reach zero within six hours, 5 that the disk has room but swap is nearly full of its own
total (memory being held, which step 3 below covers, #2559), and 2 that it could not measure, which
is not the same as fine. When it says no rate yet, take the next reading on a later turn, ten or more minutes on,
rather than waiting inside a command.

The six hours of readings roll on, so on a 3 or 4 the check also keeps a copy of the readings behind
the warning, for 14 days (FREE_SPACE_WARNING_KEEP_DAYS), and then deletes it (#3157). A new file
starts at most once every six hours per volume (four a day, 57 in 14 days, however often the disk
dips); later warnings add their readings to the newest file. --report names it, under
~/.claude/state/free-space-warnings. A warning from last night can still be checked from it: its
first lines hold the first verdict, the exit code and the settings it was judged by, and each line
after them is one reading, epoch seconds then free bytes, oldest first, with a # exit N at <epoch>
line where a later warning began.

3. Swap, which no folder size reaches

On 2026-10-26 the disk on Daniels-MacBook-Pro-2 reached 1.1 GB free and the cause was 95 GB of
swap. Swap is kept on /System/Volumes/VM, a volume of its own that shares the disk's space, so no
du of any folder ever reaches it and every later step came back clean. It took six rounds to find,
so look at it before ranking a single folder:

sysctl vm.swapusage
df -h /System/Volumes/VM

On an ordinary day swap on that Mac was 0 to 136 MB; on the days something was leaking it was 35 to
95 GB. When it is tens of gigabytes, name what holds the memory:

top -l 1 -o mem -n 10 -stats pid,command,mem,time

Read top's MEM, not ps. The resident size ps reports cannot see pages swapped out to disk, and
that day it showed nothing above 3.5 GB while top showed Backblaze's bzserv at 117 GB and
fseventsd at 105 GB, both running since boot six days earlier. TIME says how long a process has
been accumulating.

The remedy is a restart: restarting the leaking service (quitting its app, or restarting its
service), or restarting the Mac, which gave all 95 GB back that day. Never deleting files: swap is
given back only when the memory is, and nothing deleted elsewhere on the disk touches it. The low
space warning names these holders itself when swap is more than 2% of the disk and the warning is
already firing, and, with the disk to spare, when swap is also more than 90% of its own total (exit
5, #2559).

A process left running with no parent can be the cause too, and no folder size shows it either. On
2026-11-24 19 shells a builder agent's commands had started ran on for about 90 minutes after the
agent ended, churning temporary files: free space fell 42 GB, through the file event log and swap,
while nothing under the home folder grew. A low or falling warning names any process with parent 1
whose process group leader is gone, that has run at least 10 minutes and has used at least 0.1% of
one processor over its life (#3561). It names each by the program's short name (ps's ucomm, at
most 16 characters, never its arguments, which can hold a secret) and process id, and hands over
ps -o pid,ppid,etime,time,ucomm -p with the ids it found, which only reads and, for the same
reason, prints no arguments either. Seeing what a process was started with is Dan's own read
(ps -o command -p <id>), never one a session runs into its transcript. To list the
candidates yourself (launchd's own jobs lead their group, so they are left out):

ps -axS -o pid,ppid,pgid,etime,time,ucomm | awk 'NR == 1 || ($2 == 1 && $1 != $3)'

Whether to stop one is Dan's decision, never a session's: the warning names, and nothing stops it.

4. Which program is writing

A folder ranking says where the weight is, never who is adding it, and a program can fill the disk
from a place no du of the home folder reaches. On 2026-11-25 free space fell 88 GB between 9:48 and
10:11 AM ET and no folder step explained it: the writer was Adobe Lightroom exporting, holding many
cr_sdk_*.tmp files open in its temp folder under /private/var/folders, and the space came back
when the export ended. On 2026-11-24 free space fell 21 GB in 34 minutes, in bursts with flat
stretches between, and about half of it was never named. So when free space is falling and swap
does not account for it, name the writer before ranking a single folder.

macOS keeps, for every running program, a count of the bytes it has written to disk since it
started. This reads that count twice, ten seconds apart, and sets what was written in those seconds
against what free space did over the same seconds:

python3 ~/.claude/hooks/lib/disk-writers.py

It writes nothing. Its first list, what each program wrote in the window, answers while a burst is
running; its second, what each has written since it started and when that was, still answers when
the window lands in a flat stretch between bursts. It can read only programs running as Dan, and
its second line says how many it could not (on 2026-11-25, 259 of 901: 164 running as root and 95
as other system users). Their writes are unknown, never zero. A program that started during the
window is listed with all it has written, or counted on its own line when it cannot be read; one
that took over the pid of a program listed at the first reading can be missed when either of the
two could not be read. When free space fell by much more than the programs it read wrote, it says
so in a line of its own, with both figures: the rest may be in those it could not read, or not a
program's write at all (swap, a snapshot), and the sync and backup clients of step 6 are the first
to suspect, since some of them run as root. It exits 2 when it could not read at all,
which never means that nothing is writing.

Bytes written is not space held: a program that writes temp files and deletes them, or rewrites
the same file, counts every write. So a program it names is a candidate, and one number names no
cause. It is the cause once free space falls by about what it wrote over the same window, or gives
the space back when it stops.

A file deleted while a program still has it open keeps its space until the program closes it or
quits, and has no name left in any folder, so neither du nor a find can see it. lsof can, as
a file whose NLINK is 0; the path it prints is the one the file had, so the path alone does not say
whether it is gone. This totals, for each program, the space held in files with no name left:

lsof -b -w +c 0 -n -P +L1 | awk 'NR > 1 && $5 == "REG" { s[$1 " pid " $2] += $7; n[$1 " pid " $2]++ } END { for (k in s) printf "%8.0f MB in %d files  %s\n", s[k] / 1e6, n[k], k }' | sort -rn | head -10

It too reads only Dan's programs, and says nothing about root's, with no error to show it left
them out. For one program, by the pid either command printed, this totals what it holds open by
folder, at most three levels deep, a home folder shown as ~ and any folder named as the login
shown as <login>, on any disk, which is where a temp folder full
of files that still have their names shows. It prints no file name and no login name, since what a
session runs lands in its transcript:

lsof -b -w -a -n -P -p <pid> | awk 'NR > 1 && $5 == "REG" { i = index($0, " /"); n = (i > 0) ? split(substr($0, i + 1), p, "/") : 0; if (n > 4 && p[2] == "Users") { k = "~"; for (j = 4; j < n && j < 6; j++) k = k "/" (p[j] == $3 ? "<login>" : p[j]) } else if (n > 4) { k = ""; for (j = 2; j <= 4; j++) k = k "/" (p[j] == $3 ? "<login>" : p[j]) } else k = "(other)"; s[k] += $7; c[k]++ } END { for (k in s) printf "%8.0f MB in %d files  %s\n", s[k] / 1e6, c[k], k }' | sort -rn | head -10

Every lsof here carries -b, so a network volume that has stopped answering is far less likely
to stall it, and -w, so no warning naming a mount point is printed. A listing by file name is
Dan's own read in a Terminal window of his, never one a session runs into its transcript, since it
prints every path and the login name:
lsof -b -w -a -n -P -p <pid> | awk '$5 == "REG"' | sort -k7 -rn | head -20.

The remedy for a writer is stopping it, by letting the job finish or quitting the program; deleting
what it holds frees nothing while it holds it. Whether to stop or quit one is Dan's decision, and
nothing in this step stops anything.

How many files are being created and changed, by anybody, can also be read without a password,
from the folder where macOS logs file events. The folder cannot be listed, but its own size can be
read, and on APFS a folder's size is 32 bytes per entry, the same number as its link count, two of
them the folder's own (measured on five readable folders on 2026-11-25):

stat -f 'size %z, links %l, last changed %Sm' /System/Volumes/Data/.fseventsd

Read it twice, minutes apart: entries added between the readings are files being created or changed.
It was 37,901 at 12:45 PM ET on 2026-11-25 and 38,172 four minutes later, and 347,500 on the night of
2026-11-24. No reading from a day known to be healthy exists, so one count is not evidence of
anything; a count climbing fast while free space falls is.

Before step 5's walk, look at memory:

memory_pressure | tail -1

A whole disk walk (a du of the home folder, a find by date) taken while physical memory was full
ran alongside both swap jumps on 2026-11-24. Whether it caused part of them or only coincided is not
yet known, since a photo editor was also busy during the second. So while memory is full, take the
readings above first, and say that the walk is not yet known to be safe at that moment before
starting it.

5. Where the weight is

du -x -d 2 -g ~ 2>/dev/null | sort -rn | head -30

-x keeps it on one filesystem, so it does not wander into a mounted volume or a network share
and report their sizes as yours. -g is gigabytes, which is the unit the answer is in. It is slow
on a large home directory; let it finish rather than narrowing too early.

A du figure is an upper bound on what a folder costs, never a measurement of it. du adds up
the size of every file it reaches. On APFS a file can be a clone, a copy that shares every block
with its original until one of them is written, and du counts each clone at its full size although
it costs the disk almost nothing. A hard linked file is counted once inside one du run, but in
full again by every separate run that reaches it, so two du commands over neighboring folders
can each claim the same bytes. Deleting a clone or one link of a file frees almost nothing.

So a folder growing between two du readings is real growth only when df's free space (step 1)
fell by about the same amount over the same interval. When du says a folder grew by tens of
gigabytes and df says the disk did not lose them, the folder is not the cause, however neatly its
timing fits.

A known false lead: Chrome's code signing clones. Chrome makes a clone of its whole app bundle
under /var/folders/*/*/X/com.google.Chrome.code_sign_clone (the per user folder
getconf DARWIN_USER_CACHE_DIR names, with X in place of its last C) each time it
launches, and a Chrome that is force quit leaves its clone behind. On 2026-10-08 du counted 114 of them at about 1.5 GB
each, apparently 60 GB of growth in five hours; deleting 90 of them freed 0 bytes by df. They are
clones of Chrome.app, so they cost almost no real space. Rule this folder out rather than in. Most
of those came from design rounds' headless Chrome, which since claude-config#988 is told not to make
one (--disable-features=MacAppCodeSignClone, in skills/design-rounds/headless-dom.sh). Of the
288 found from 2026-10-20 to 22, every one whose launcher was traced (19, in two full suite runs on
2026-10-22) came from the design score's Playwright runs, which since claude-config#1537 start
Chrome through that same file.

6. The sync and backup clients, before anything else you find

These are the ones that fill a disk while looking idle, and they are the first place to look
whatever step 5 said, because their staging areas are often outside the home directory and often
newer than anything du ranks highly.

Synology Drive. The 2026-09-10 cause: a backup task with the whole home folder in scope,
staging at about 19 GB an hour.

du -x -d 1 -g ~/Library/Application\ Support/SynologyDrive 2>/dev/null | sort -rn | head

Its session list, which says what each task has in scope:

sqlite3 -readonly ~/Library/Application\ Support/SynologyDrive/data/db/sys.sqlite "select * from session_table;" 2>/dev/null

The staging area, which is what actually grows:

du -x -d 2 -g ~/Library/Application\ Support/SynologyDrive/data/session 2>/dev/null | sort -rn | head

Backblaze. Its data folder was readable without a password on Daniels-MacBook-Pro-2 on
2026-10-08 (it is world readable), so this runs as it is. Errors are left showing on purpose: a
"Permission denied" line means the total below it is short, and then the full size needs Dan to run
the same command with sudo in front, which is his to run, never Claude's.

du -x -d 1 -g /Library/Backblaze.bzpkg/bzdata | sort -rn | head

iCloud. Files evicted from local storage still show in Finder. What matters is what is
downloaded:

brctl quota 2>/dev/null; du -x -d 1 -g ~/Library/Mobile\ Documents 2>/dev/null | sort -rn | head

7. The macOS symbol cache, which only an administrator can measure

/System/Library/Caches/com.apple.coresymbolicationd is filled by coresymbolicationd whenever a
crash report is written or a process is sampled (sample, spindump, Instruments). It keeps symbols
per build, so every fresh build of an app that crashes or is sampled adds another copy, and a day of
agents building and crash testing can put well over a hundred gigabytes there. It lives on the data
volume, not the read only system snapshot, so it counts against the free space step 1 reports.

It is owned by root with no access for anyone else, so du without sudo reads nothing, and step 5
never sees it. Say that plainly rather than reporting it as small or absent. What can be read
without a password is when a file was last added to it or removed from it, which says it is in use
and nothing about its size:

ls -ld /System/Library/Caches/com.apple.coresymbolicationd

Its size needs Dan's password, so hand him the command rather than running it:

sudo du -sh /System/Library/Caches/com.apple.coresymbolicationd

It is a cache macOS rebuilds on demand, so clearing it costs only the time to symbolicate the next
crash reports. Clearing it is Dan's call, as every deletion is, and only once the size above shows
it is large. This command is for Dan to run, never for Claude. The folder carries no SIP restricted flag, so sudo can empty it. find -mindepth 1 -delete empties it, hidden files included, and keeps the folder and its root only
permissions; it needs no glob, which Dan's zsh would refuse before sudo ran because his user
cannot list the folder:

sudo find /System/Library/Caches/com.apple.coresymbolicationd -mindepth 1 -delete

The low space warning names this folder and both commands itself when its verdict is low or falling
and the folder exists, so if it has already fired that way, those are the same ones.

8. The usual large caches, once the above are ruled out

du -x -d 1 -g ~/Library/Caches ~/Library/Containers ~/Library/Developer 2>/dev/null | sort -rn | head -20

Xcode's ~/Library/Developer/Xcode/DerivedData and ~/Library/Developer/CoreSimulator are the two
that reach tens of gigabytes without anybody noticing.

DerivedData leaks for a known reason: Xcode keeps one build cache per project path, every agent
worktree, scratch copy and temporary gate tree is a new path, and nothing removes the cache when the
path is deleted. On 2026-10-19 that was 30 folders, about 48.6 GB, all keyed to paths that no longer
existed. A du of the folder cannot tell those from caches still in use, so list them with the
sweep, which reads each folder's recorded project path and deletes nothing:

bash ~/.claude/hooks/derived-data-sweep.sh

It groups every folder by what it decided: orphaned (the project path is gone, with size, last
modified date and the path it recorded), orphaned but kept because something in it was written in
the last hour or a running xcodebuild names it, no info.plist (nothing can say whose it is, so
never deleted), a project on a volume that is not mounted (an unplugged drive, never deleted), and
still in use.

Dan decided on 2026-10-20 (#1369) that the orphans may be deleted on its own: when the low space
warning fires it starts a sweep in the background that removes only the orphans nothing is using,
and the next warning says what that sweep deleted, the df gain it measured, or that it failed. So
if the warning has fired, read what the last sweep did before deleting anything by hand:

bash ~/.claude/hooks/derived-data-sweep.sh --last

On a Mac where Dan has set FREE_SPACE_DERIVED_DATA_AUTO_DELETE=0 the warning only counts them,
and deleting is Dan's decision each time, as every deletion is. When Dan has said to, this removes
only the orphans nothing is using, judging each again just before removing it, and reports the
df -m gain beside the du figure:

bash ~/.claude/hooks/derived-data-sweep.sh --delete

9. Snapshots, which du cannot see at all

Space held by local Time Machine snapshots does not appear in any directory listing, so a disk can
be full with nothing to find.

tmutil listlocalsnapshots / 2>/dev/null

Reporting it

Say the rate before the size, and name what is growing rather than what is big. "Synology Drive is
staging about 19 GB an hour into its session folder, which is why deleting things is not helping"
is actionable. "The disk is full and Caches is 40 GB" is not, because Caches was 40 GB last week
too.

Name no cause you have not measured. A folder being large is not evidence it is the one filling the
disk; a folder growing between two readings is, once df shows the disk lost about the same amount
over the same interval (step 5 says why du's growth alone can be no growth at all).

Deleting anything

To clear space once the cause is known, point Dan to /disk-clean, which he types himself: it
scans the caches, build folders, the Trash and forgotten files that can go, shows them on one review
page where he ticks what goes, and removes them through disk-remove.sh with the result checked by
df. What follows is for the few things this sequence found by path that the scan does not cover.

Everything above is read only on purpose, except two deleting commands: the clearing command in
step 7, which is Dan's to run once he has seen the size, and the sweep's --delete in step 8, which
the low space warning runs on its own (Dan's decision of 2026-10-20) and which by hand runs only
once Dan has decided to clear the orphaned Xcode caches it listed. Step 2's check also deletes, by
itself, its own copies of a warning's readings once they are 14 days old (#3157), and nothing else.
Anything else goes through
disk-remove.sh, never a hand typed rm, mv or trash. It never removes a sync or cloud
client's store, iCloud Drive, an app package, a Photos or photo editor library, the Mail or Messages
stores, keys and credentials, or anything under /Applications or /System; it checks each item again
just before removing it, writes what it is about to do to a log first, and checks afterwards that
each item really went. Before removing anything:

  • Say what you propose to delete, how much you predict it frees, and what regenerates it. The
    prediction is a claim about df, not about du, which overstates anything holding clones or
    hard links (step 5).
  • Stop the thing that is writing first. Deleting under an active writer frees space that is
    reclaimed within minutes and hides the cause.
  • Never delete from a sync or backup client's own store to free space. Change its scope or pause it
    in its own interface, because its store is the client's record of what it has done and removing
    it by hand leaves the client repairing itself, which writes more.

Propose what you mean to remove, by path, with one method for the lot: trash for anything Dan may
want back, delete for a cache that regenerates, and truncate for a log a running process still
holds open (it is emptied in place, since deleting a file that is held open frees nothing until the
process lets go). This measures each path, refuses the ones it never removes, removes nothing, and
writes a plan. Name each path without a trailing slash, which it refuses (#3332):

bash ~/.claude/hooks/lib/disk-remove.sh --propose trash ~/Downloads/old-installer.dmg

Show Dan what it offered and refused, with the sizes. Once Dan has decided, run the --plan command
it printed, within the hour, after which the plan is refused as stale:

bash ~/.claude/hooks/lib/disk-remove.sh --plan ~/.claude/state/disk-clean/named/<the id it printed>.plan

It prints one line per item (removed, trashed, truncated, skipped with the reason, or failed with the
error) and the verified total, which is the sum of each item's own size, measured just before it
went and checked gone after. Moving to the Trash frees nothing until the Trash is emptied, and the
report counts trashed items apart for that reason. Exit 0 means every item went; 5 means at least
one was skipped or failed, and the lines say which and why; 3 and 4 mean the plan is stale or for
another scan, so propose again.

Then confirm the gain. Take this reading just before the delete and again just after, and compare
the difference with the prediction. It is in megabytes because whole gigabytes cannot tell a gain
of 1.5 GB from none at all:

df -m /System/Volumes/Data

A gain far below the prediction means the diagnosis was wrong. Stop and go back to the readings
rather than deleting more of the same thing: on 2026-10-08 ninety deletions went ahead on a du
figure before anyone checked that the first had freed nothing.