claude-code - 💡(How to fix) Fix CLI auto-updater doesn't clean up old binaries, triggers repeated macOS TCC permission dialogs [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48311Fetched 2026-04-16 07:03:22
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

The native CLI installer accumulates old version binaries in ~/.local/share/claude/versions/ without cleanup. Each new binary is a distinct code-signed Mach-O executable, which causes macOS TCC to treat each version as a new app — triggering fresh permission dialogs for Downloads, Photos, Documents, etc.

Root Cause

  • Disk waste: Each binary is ~200MB. No cleanup means unbounded growth.
  • TCC dialog spam: Each new version triggers fresh macOS privacy consent dialogs. For interactive users this is a minor annoyance (click Allow once). For headless/LaunchAgent usage, dialogs pile up while the user is AFK.
  • The version number appears as the app name in the dialog because the binary filename is 2.1.109, not claude. Users won't know what's asking for access.

Fix Action

Workaround

Manual cleanup: cd ~/.local/share/claude/versions/ && ls | grep -v <current_version> | xargs rm

Co-Authored-By: Claude Opus 4.6 [email protected]

RAW_BUFFERClick to expand / collapse

Summary

The native CLI installer accumulates old version binaries in ~/.local/share/claude/versions/ without cleanup. Each new binary is a distinct code-signed Mach-O executable, which causes macOS TCC to treat each version as a new app — triggering fresh permission dialogs for Downloads, Photos, Documents, etc.

Environment

  • macOS 15 (Darwin 25.3.0), Apple Silicon
  • Claude Code installed via native installer (not Homebrew)
  • CLI invoked headlessly via LaunchAgents (claude -p)

Reproduction

  1. Install Claude Code CLI natively
  2. Let auto-updater run for a few days
  3. Check ~/.local/share/claude/versions/ — multiple ~200MB binaries accumulate (6 versions = 1.1GB in my case)
  4. The symlink at ~/.local/bin/claude points to the latest, but old versions remain on disk
  5. macOS shows permission dialogs like "2.1.108" would like to access files in your Downloads folder — using the version number as the app name since the binary is named by version, not "claude"

Impact

  • Disk waste: Each binary is ~200MB. No cleanup means unbounded growth.
  • TCC dialog spam: Each new version triggers fresh macOS privacy consent dialogs. For interactive users this is a minor annoyance (click Allow once). For headless/LaunchAgent usage, dialogs pile up while the user is AFK.
  • The version number appears as the app name in the dialog because the binary filename is 2.1.109, not claude. Users won't know what's asking for access.

Suggested fixes

  1. Clean up old binaries after a successful update (keep current + one previous for rollback)
  2. Preserve TCC grants across updates — if the designated code requirement stays the same, macOS should carry forward permissions. The current layout (new standalone binary per version) defeats this.
  3. Name the binary claude (or wrap it in a .app bundle with a stable name) so TCC dialogs show a recognizable app name instead of a version number

Workaround

Manual cleanup: cd ~/.local/share/claude/versions/ && ls | grep -v <current_version> | xargs rm

Co-Authored-By: Claude Opus 4.6 [email protected]

extent analysis

TL;DR

Clean up old binaries after a successful update to prevent disk waste and TCC dialog spam.

Guidance

  • Implement a cleanup mechanism to remove old binaries after a successful update, keeping only the current and previous versions for rollback.
  • Consider preserving TCC grants across updates by using a stable binary name or wrapping the binary in a .app bundle.
  • Rename the binary to claude to ensure TCC dialogs display a recognizable app name instead of a version number.
  • Use the provided manual cleanup workaround: cd ~/.local/share/claude/versions/ && ls | grep -v <current_version> | xargs rm to temporarily mitigate the issue.

Example

No code snippet is provided as it is not clearly supported by the issue.

Notes

The suggested fixes and workaround are based on the information provided in the issue and may not be exhaustive. The cleanup mechanism and preservation of TCC grants may require additional implementation details.

Recommendation

Apply the workaround by implementing a cleanup mechanism to remove old binaries after a successful update, as it directly addresses the issue of disk waste and TCC dialog spam. This approach is a more targeted solution compared to simply upgrading to a fixed version, which is not mentioned in the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING