Codex runs git add and git commit in parallel, causing index.lock errors

Resolved 💬 2 comments Opened Apr 11, 2026 by jinjor Closed Apr 11, 2026

What version of Codex CLI is running?

codex-cli 0.120.0

What subscription do you have?

ChatGPT Plus

Which model were you using?

gpt-5.4

What platform is your computer?

Darwin 25.3.0 arm64 arm

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

VSCode

What issue are you seeing?

When Codex tried to commit changes, the commit failed with a Git index.lock error.

What steps can reproduce the bug?

  1. Open a Git repository with modified files.
  2. Ask Codex to commit the current changes.
  3. Codex invokes git add ... and git commit -m "..." in parallel.
  4. The git commit command fails with an index.lock error.

What is the expected behavior?

Codex should run Git write operations sequentially, not in parallel.

For example:

  1. git add
  2. wait for completion
  3. git commit
  4. wait for completion
  5. git push

Additional information

In my experience, this happens frequently.

In this case, the lock file was removed automatically, so retrying the commit succeeded. Because of that, this is not always a blocking problem in practice, but it does interrupt the workflow and produces avoidable Git errors.

The error was:

fatal: Unable to create '/path/to/repo/.git/index.lock': File exists.

Another git process seems to be running in this repository...

View original on GitHub ↗

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