Skip to content

CLI sandbox: cannot commit because .git is read-only (“Unable to create .git/index.lock”) #7071

@lemmon

Description

@lemmon

What version of Codex is running?

codex-cli 0.61.0

What subscription do you have?

Plus

Which model were you using?

gpt-5.1-codex-max (Medium)

What platform is your computer?

Darwin 24.6.0 arm64 arm

What issue are you seeing?

On the Codex CLI, git commit fails with fatal: Unable to create '/path/.git/index.lock': Operation not permitted. The .git directory appears read-only to the assistant process (even touch .git/test-permission fails). This blocks committing from the CLI.

Notes

  • Previously (older CLI version) commits worked; recent updates reintroduced the read-only .git behavior.
  • The underlying user shell (outside Codex) can commit fine; this is specific to the Codex sandbox permissionson .git.

What steps can reproduce the bug?

Uploaded thread: 019aa1d3-cb45-72b2-accf-b5b040ec1e9

What is the expected behavior?

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIbugSomething isn't workingsandboxIssues related to permissions or sandboxing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions