[Bug] Parallel worktree agents lose Bash permissions mid-execution and fail to import editable installs
Bug Description
parallel worktree agents are facing issues:Attempt: Previous session (worktree Bash agents)
Result: Couldn't write files — sandbox blocked basic
operations
────────────────────────────────────────
Attempt: This session diagnostic
Result: All 10 operations passed (write, pytest,
commit, etc.)
────────────────────────────────────────
Attempt: This session real agents (3 worktrees)
Result: Wrote all files successfully, but lost Bash
permissions mid-execution — couldn't run pytest,
ruff, black, or git commit
────────────────────────────────────────
Attempt: Editable install problem
Result: pip install -e . points to one directory;
worktree agents' source isn't on the Python path,
so
tests import the wrong code
Net result: All 3 worktree agents produced files but
couldn't test or commit. I had to throw away the
worktrees and re-implement everything sequentially in
the main workspace. The sequential approach took
about the same wall-clock time since I wasn't
fighting permission issues.
Root causes:
- Bash permission loss — agents lose shell
permissions partway through execution (possibly a
Claude Code sandbox issue)
- Editable install is workspace-global — Python's
pip install -e . creates a single symlink, so
worktree source trees aren't importable without a
separate pip install -e . per worktree
- No persistent shell state — each Bash call is a
fresh shell, so cd and source don't persist, making
worktree setup fragile
For Phase 2, I'd recommend we just run sequentially
again (the two parallel branches are small enough
that it's faster than debugging agent issues), unless
you want to try filing the permission bug with
Anthropic first.
Environment Info
- Platform: linux
- Terminal: vscode
- Version: 2.1.50
- Feedback ID: ba6f29eb-bb13-405a-bc52-f0d31f722c89
Errors
[{"error":"Error: NON-FATAL: Lock acquisition failed for /root/.local/share/claude/versions/2.1.50 (expected in multi-process scenarios)\n at qwR (/$bunfs/root/claude:2598:2098)\n at yjA (/$bunfs/root/claude:2598:1818)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-02-21T13:43:33.650Z"},{"error":"Error: Request was aborted.\n at makeRequest (/$bunfs/root/claude:300:3940)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-02-21T14:07:19.347Z"},{"error":"Error: Request was aborted.\n at nXR (/$bunfs/root/claude:1391:50898)\n at next (native:1:11)\n at da_ (/$bunfs/root/claude:5020:5869)\n at next (native:1:11)\n at ia_ (/$bunfs/root/claude:5025:9125)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-02-21T14:23:11.352Z"},{"error":"Error: File does not exist. Note: your current working directory is /workspace/nl-lean/.claude/worktrees/agent-af66479c.\n at call (/$bunfs/root/claude:4821:6302)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-02-21T14:23:21.053Z"},{"error":"Error: File does not exist. Note: your current working directory is /workspace/nl-lean/.claude/worktrees/agent-af66479c.\n at call (/$bunfs/root/claude:4821:6302)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-02-21T14:23:41.736Z"},{"error":"Error: File does not exist. Note: your current working directory is /workspace/nl-lean/.claude/worktrees/agent-af66479c.\n at call (/$bunfs/root/claude:4821:6302)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-02-21T14:23:41.738Z"},{"error":"Error: File does not exist. Note: your current working directory is /workspace/nl-lean/.claude/worktrees/agent-af66479c.\n at call (/$bunfs/root/claude:4821:6302)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-02-21T14:23:41.740Z"},{"error":"Error: File does not exist. Note: your current working directory is /workspace/nl-lean/.claude/worktrees/agent-af66479c.\n at call (/$bunfs/root/claude:4821:6302)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-02-21T14:23:41.745Z"},{"error":"Error: File does not exist. Note: your current working directory is …
Note: Content was truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗