[BUG] TeamCreate sub-agents mangle iCloud Drive paths — tildes in com~apple~CloudDocs get transformed

Resolved 💬 2 comments Opened Mar 10, 2026 by Spidey-IO Closed Apr 7, 2026

Bug Description

Sub-agents spawned via TeamCreate (software-team) mangle the iCloud Drive working directory path. The ~ characters in com~apple~CloudDocs are transformed, corrupting the path so file reads fail or hit wrong locations.

Observed Behavior

A @dev-1 sub-agent (Engineer role from software-team) attempted to read a file and the path was mangled:

Expected path:

~/Library/Mobile Documents/com~apple~CloudDocs/LGX/Claude Code Test/CL_MVP/agent/agent_config.ts

Actual path shown in permission prompt:

~/Library/Mobile Documents/com-apple-Claude Code Test/CL_MVP/agent/agent_config.ts

The com~apple~CloudDocs segment became com-apple- — tildes were replaced with hyphens and CloudDocs was dropped entirely.

Screenshot

The permission prompt from the sub-agent showed:

Read file · @dev-1
Read(~/Library/Mobile Documents/com-apple-Claude Code Test/CL_MVP/agent/agent_config.ts)

Steps to Reproduce

  1. Open Claude Code in a project directory under iCloud Drive: ~/Library/Mobile Documents/com~apple~CloudDocs/...
  2. Spawn a software-team via TeamCreate (or any sub-agent via the Agent tool)
  3. Have the sub-agent attempt to read a file in the project
  4. Observe the path in the permission prompt — com~apple~CloudDocs is mangled

Environment

  • Platform: macOS (Darwin 24.2.0)
  • Working directory: ~/Library/Mobile Documents/com~apple~CloudDocs/LGX/Claude Code Test/
  • Agent type: software-team (TeamCreate), specifically the Engineer sub-agent (@dev-1)

Root Cause Hypothesis

The ~ character in com~apple~CloudDocs is likely being interpreted or transformed during path resolution when the working directory is passed to sub-agents. This is distinct from the spaces issue (#1726) — the tildes in the directory name itself are the problem, not shell home directory expansion.

Related Issues

  • #1726 — CLI fails to escape file paths with spaces in bash commands (same iCloud path, different symptom)
  • #19518 — MCP server fails to connect from directory with spaces/special characters (tilde in iCloud paths)
  • #29859 — Cannot create files/folders when workspace path contains accented characters (special characters in sub-agent paths)

View original on GitHub ↗

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