anthropics / anthropics/claude-code

[Bug] macOS TCC permissions lost on auto-update due to versioned binary paths

Open
#94,878 0 comments 0 reactions 1 assignee Assigned to @bogini View on GitHub
area:agent-view area:packaging bug duplicate has repro platform:macos
Dominant language
Python
Stars
145k
Forks
23.1k
PR merge metrics
PR metrics pending

Description

**Bug Description**
macOS: background sessions lose TCC permissions on every update (spare pty-hosts skip the ClaudeCode.app responsibility disclaim)

What happens
Background sessions intermittently get "Operation not permitted" on ~/Documents, and after each auto-update macOS prompts again, e.g. '"2.1.273" would like to access data from other apps.' The user TCC.db holds a new path-keyed (client_type=1) row set for every version dir, ~/.local/share/claude/versions/2.1.232 through 2.1.273. So one grant never survives an update.

Expected
A single grant to the stable bundle identity (com.anthropic.claude-code, ~/.local/share/claude/ClaudeCode.app) covers all background sessions across updates. Full Disk Access is granted to that bundle here, but prompts for "2.1.273" still appear.

Cause (from the 2.1.272 binary and tccd logs)
1. In the --bg-pty-host startup, `if(!t)await z()` skips the ClaudeCode.app re-exec with macDisclaimResponsibility when --bg-spare is set. Sessions claimed from a spare keep the daemon's responsible process: the launching terminal (e.g. Hyper) or the versioned binary path.
2. Even for non-spare pty-hosts that do re-exec through ClaudeCode.app, tccd resolves the hardlinked binary inconsistently. Within the same pid, one AUTHREQ_ATTRIBUTION shows responsible_path=.../ClaudeCode.app/Contents/MacOS/claude and a later one shows responsible_path=.../versions/2.1.272. The path identity changes with every update.

Repro
1. Start the daemon from a terminal (`claude agents`).
2. Run a background session that reads ~/Documents or another app's container.
3. Let Claude Code auto-update, then do it again: a new TCC prompt names the new version number.
4. `log show --predicate 'subsystem == "com.apple.TCC" AND eventMessage CONTAINS "AUTHREQ_ATTRIBUTION"'` shows the responsible identity switching between the bundle and the versions/ path.

Environment
Claude Code 2.1.272 / 2.1.273, native install (~/.local/share/claude), macOS Darwin 25.6.0, Apple Silicon.

Suggested fix
Always disclaim responsibility and exec through the ClaudeCode.app path, spares included. Pass the bundle path, not versions/X, as the child executable so the kernel records one stable executable path.

**Environment Info**
- Platform: darwin
- Terminal: xterm-256color
- Version: 2.1.273
- Feedback ID: 84f0e550-679f-4830-81c2-ae62029eda89

**Errors**
```json
[]
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the --bg-pty-host startup path, including the --bg-spare branch and the macDisclaimResponsibility re-exec, then reproduce with the supplied tccd log predicate. Done means background sessions consistently use the stable ClaudeCode.app identity and updates no longer trigger version-specific TCC prompts.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos
Domain
operating-systems, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.