Skip to content

workspace-write cannot write inside repo subdirectory agents/ #21620

Open

Description

@talltaco

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.

Activity

  1. added
    bug
    on May 8, 2026
  2. added
    CLI
    sandbox
    on May 8, 2026
  3. github-actions commented on May 8, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  4. talltaco commented on May 8, 2026

    @talltaco
    Author

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIbugsandbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions