[BUG] bwrap fails in a worktree when .claude/skills is a symlink in a repository

Open 💬 5 comments Opened Apr 7, 2026 by ElectronicRU

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Hello,
Our repository at my job has the following setup:
.ai-agents/skills
.claude/skills --> ../.ai-agents/skills

This causes Claude to fail with sandbox: true, bwrap installed and launching with --worktree. See error message below.

What Should Happen?

sandbox: true is expected to work with worktrees regardless of repository structure.

Error Messages/Logs

● Bash(pwd && ls .claude/)                                                                   
  ⎿  Error: Exit code 1                                           
     bwrap: Can't create file at /home/claude-aiven-3/git/aiven-core/.claude/skills: Is a    
     directory

Steps to Reproduce

  1. Create a new git repository
  2. mkdir -p .ai-agents/skills
  3. mkdir .claude
  4. Symlink .claude/skills to point to .ai-agents/skills
  5. Launch Claude Code from this workspace with claude --worktree test with sandbox enabled in settings.json
  6. Have the Claude instance execute a bash command

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.92 (Claude Code)

Platform

AWS Bedrock

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

The problem goes away with copy-pasted directories. I would guess that bwrap has a problem when copying over the .claude directory because it doesn't check the subdirectories existing with lstat, although I could be wrong.

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗