Folder

Is /private/tmp/claude-501 safe to delete on a Mac?

Careful: /private/tmp/claude-501 (the number is your user id) holds the output of Claude Code's background commands and subagents, so delete the .output files of finished sessions and leave running sessions and scratchpads alone.

1 safe3 never

updated read 4 minfor Claude Code on macOS

The short answer

  1. 01

    Careful. The folder name ends in your user id, which is 501 for the first account on a Mac.

  2. 02

    Claude Code writes it for every background command and subagent task, one .output file each.

  3. 03

    It has no cleanup. A GitHub issue reports no TTL, no session cleanup and no size cap, with one session at 537 GB.

  4. 04

    Safe to delete once the session is finished: the .output files in tasks folders. Quit Claude Code first.

  5. 05

    Never delete a running session's output, or the scratchpad folders agents keep notes in.

See its real size on your Mac. Hoardless measures this folder and previews the delete.Download free trial

What is /private/tmp/claude-501?

It is Claude Code's temporary folder, outside ~/.claude. The 501 is the user id of the account that ran Claude Code, so yours may differ. The layout comes from the public bug report anthropics/claude-code#26911, which gives the path as /private/tmp/claude-501/<cwd-slug>/tasks/<task id>.output. A later comment on the issue shows a session folder in between: <cwd-slug>/<session id>/tasks/. On a real Mac running Claude Code 2.1.317, Hoardless saw that deeper layout, with a scratchpad folder next to tasks.

  • tasks/*.output: output of background commands and subagent tasks, one file per task.
  • scratchpad: files an agent wrote for itself during a session.

What writes it and why does it grow?

Claude Code writes an output file for each background task it starts. Nothing removes them: the issue says the files persist indefinitely, with no TTL, no session cleanup and no size cap. Reports in the issue include a single session at 537 GB across 1,247 files, and single files of 254 GB and 271 GB. The issue was closed as not planned, so check the folder yourself.

A background command that prints a lot, such as a watcher or a verbose test run, can fill its output file while the session is still going.

How big does it get?

Usually small. The reports above are outliers. Check yours:

du -sh /private/tmp/claude-$(id -u)/* | sort -h

Lists the size per project folder, largest last. Removes nothing. id -u prints your user id.

find /private/tmp/claude-$(id -u) -path '*/tasks/*.output' -size +100M

Lists output files over 100 MB. Removes nothing.

Is it safe to delete?

WhatVerdictWhat you lose
.output files of finished sessionsSafeThe saved output of those background tasks.
.output files of a running sessionNeverThe session loses output it may still read or write.
scratchpad foldersNeverNotes and files an agent kept there.
Symlinks inside tasksNeverSome subagent outputs are symlinks into ~/.claude/projects. Deleting with -r through one can remove a transcript.

How do I clean up /private/tmp/claude-501?

The cheapest safe fix is a restart. macOS empties /private/tmp when it restarts, so the folder starts over. To free space without restarting, use the steps below.

Quit every Claude Code session first, including IDE extensions and the desktop app, then delete regular output files only:

find /private/tmp/claude-$(id -u) -path '*/tasks/*.output' -type f -delete

Deletes every task output file permanently, without the Trash. -type f skips symlinks, and the path filter leaves scratchpads alone. Run the find from the check above without -delete first to see what it will remove.

What Hoardless does: its Claude Code detector lists .output files as one Confirm row named Task output. A file is listed only when it has been quiet for an hour and its session is not running. A session counts as running when a Claude Code process runs in that project's folder, when any process has a file open inside the session folder, when Claude Code's session registry names it with a live process, or when its transcript was written in the last hour. If Hoardless cannot read the list of open files, it lists nothing from this folder. It lists regular files directly in a tasks folder, never a symlink. It never touches scratchpads, transcripts, settings, CLAUDE.md, memory, skills, plugins or ~/.claude.json. Everything goes to the Trash with an undo log, and it re-checks each file when you confirm.

What comes back and when?

New background tasks write new output files, so the folder grows again with use. Deleted output does not come back.

Task output of finished sessions, never a running one

Hoardless lists Claude Code task output only for sessions it can show are finished, skips scratchpads and symlinks, and moves what you pick to the Trash with an undo log (Confirm tier).

14-day full trial. macOS 14 or later.

Questions

How do I find my user id for the folder name?

Run id -u in Terminal. The first account on a Mac is usually 501, so the folder is /private/tmp/claude-501.

Does Claude Code clean up /private/tmp/claude-501 by itself?

Not according to the public bug report. Issue 26911 in the claude-code repository says the files persist indefinitely with no TTL, no session cleanup and no size cap. The issue was closed as not planned.

Is this the same as ~/.claude?

No. ~/.claude holds your settings and transcripts and has its own cleanupPeriodDays sweep. This folder is in /private/tmp and is outside that sweep.

Will deleting it break my transcripts?

No. Transcripts live in ~/.claude/projects. Some subagent output files here are symlinks into that folder, so delete regular files only and never follow a link.

Can one output file really be hundreds of GB?

The issue reports single files of 254 GB and 271 GB, one of them growing about 2 GB a minute. That is a bug report, not typical use.