workspace-write cannot write inside repo subdirectory agents/

Open 💬 2 comments Opened May 8, 2026 by talltaco
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

0.128.0

What subscription do you have?

Pro

Which model were you using?

gpt-5.5 high

What platform is your computer?

Darwin 23.5.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

iTerm2

What issue are you seeing?

Codex CLI 0.128.0
macOS
Started with:
codex -s workspace-write --add-dir /path/to/repo/agents -C /path/to/repo

Expected:
workspace-write can write inside repo subdirectory agents/, especially with --add-dir.

What steps can reproduce the bug?

Actual:
writing to repo root succeeds
writing to agents/.codex-sandbox-write-test fails:
zsh: operation not permitted: agents/.codex-sandbox-write-test

What is the expected behavior?

Expected:
workspace-write can write inside repo subdirectory agents/, especially with --add-dir.

Additional information

Notes:
agents/ is a normal directory, not a symlink.
.agents is a symlink to agents, but the failing path is agents/ itself.

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 3 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #21081

Powered by Codex Action

talltaco · 3 months ago

_Potential duplicates detected. Please review them and close your issue if it is a duplicate._

That doesn't seem to be the same issue.

My suspicion is that there is something happening that blocks edits in a folder named agents/, even if that folder is in the repo that the agent has access to.

In a previous version of the CLI, adding --add-dir /path/to/repo/agents as an arg worked around it, that doesn't seem to be working anymore.

That extra arg should not even be necessary.