[Bug] Sandbox blocks uv cache access during pytest execution

Status Closed — not planned
Maintainer reply None cached
Activity 8 comments · opened Oct 24, 2025 · closed Feb 1, 2026

Bug Description
When using sandbox and uv together, running pytest fails because it cannot access $HOME/.cache/uv/sdists-v9/.git.

⏺ Bash(uv run pytest -v)
⎿  Error: error: failed to open file $HOME/.cache/uv/sdists-v9/.git: Operation not permitted (os error 1)

<sandbox_violations>
uv(9813) deny(1) file-write-data $HOME/.cache/uv/sdists-v9/.git
</sandbox_violations>

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.0.26
  • Feedback ID: 1c792d06-9b35-4f79-9656-056b857900f1

Errors
⏺ Bash(uv run pytest -v)
⎿  Error: error: failed to open file $HOME/.cache/uv/sdists-v9/.git: Operation not permitted (os error 1)

<sandbox_violations>
uv(9813) deny(1) file-write-data $HOME/.cache/uv/sdists-v9/.git
</sandbox_violations>

View original on GitHub ↗

8 Comments

higumachan · 10 months ago

I have already added $HOME/.cache to add-dir.

/add-dir
Permissions:  Allow   Ask   Deny   Workspace   (tab to cycle)
 Claude Code can read files in the workspace, and make edits when auto-accept edits is on.

   -  /Users/<username>/ghq/github.com/higumachan/claude-sandbox-check/pytest_with_uv (Original working directory)
 ❯ 1. /Users/<username>/.cache
   2. Add directory…
lior-airis · 9 months ago

Something weird happened to me:

  1. Added Edit(/Users/<username>/.cache/**) to the permissions section
  2. It immediately worked and I was able to run "uv run python.." no problem
  3. After a while it STOPPED working and i noticed that the Edit() has VANISHED from ~/.claude/settings.json

What's going on?
The full edit:

```bash[/+]
⏺ Update(~/.claude/settings.json)[/+]
⎿ Updated ../../.claude/settings.json with 2 additions and 4 removals
2 "permissions": {
3 "allow": [
4 "WebFetch",
5 - "WebSearch"
5 + "WebSearch",
6 + "Edit(~/.cache/)"
7 ],
8 "deny": [
9 "Read(~/.aws/
)",
...


I'm on Mac
github-actions[bot] · 8 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

lynchifer · 8 months ago

Hey, just adding that we are also running into this configuration limitation for subprocesses. It would be nice to be able to allow .git access (or I suppose .cache) outside the working directory and in sandbox, either explicitly or with ignoreViolations. I verified this is still happening in v2.0.76.

Would be nice to do something like (currently not honored)

"ignoreViolations": {
    "*": ["~/.cache"]
},
lior-airis · 8 months ago

Same here, please allow Claude code to respect Edit(/path/.git/**) as well

github-actions[bot] · 7 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

marcindulak · 7 months ago

This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.

github-actions[bot] · 6 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.