codex - 💡(How to fix) Fix Empty .codex folder in each repo I work on [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17465Fetched 2026-04-12 13:28:14
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×2closed ×1commented ×1
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

0.120.0

What subscription do you have?

Plus

Which model were you using?

gpt-5.4

What platform is your computer?

Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64

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

Windows Terminal (WSL)

What issue are you seeing?

Since version 0.118.0 or something, I noticed that Codex CLI always creates an empty .codex in each repository I work on. Why? It’s a bit annoying, also b/c GPT-5.4 wastes a few tokens in every reply to remind me of the stray folder

What steps can reproduce the bug?

  1. mkdir foobar && cd foobar
  2. git init foobar
  3. codex init
  4. let Codex do its thing for a while (even creating a simple weather-overview.js function will do)
  5. et voilà! You have a stray .codex folder in your repo. You can keep deleting it, and Codex will keep creating it and being bewildered at the existence of it (• The repo is effectively clean. Only the stray untracked .codex file is left.)
<img width="672" height="152" alt="Image" src="https://github.com/user-attachments/assets/17793670-6dd2-4f23-bbdc-484d73ee9b56" />

What is the expected behavior?

Don't create an empty .codex folder, or at least be aware that you (Codex) created it, instead of complaining at each output prompt that "there's a stray .codex folder

Additional information

No response

extent analysis

TL;DR

The issue can be mitigated by configuring Codex CLI to avoid creating the empty .codex folder or by adding it to the .gitignore file to prevent it from being tracked.

Guidance

  • Verify that the .codex folder is not required for the project by checking the Codex CLI documentation or configuration options.
  • Add the .codex folder to the project's .gitignore file to prevent Git from tracking it and Codex CLI from complaining about the "stray" folder.
  • Check if there are any configuration options in Codex CLI version 0.120.0 to disable the creation of the .codex folder.
  • Consider reporting this issue to the Codex CLI developers as a potential bug or feature request.

Notes

The provided information does not specify a clear reason why the .codex folder is being created, so it's unclear if this is a bug or an intended feature.

Recommendation

Apply workaround: Add the .codex folder to the project's .gitignore file, as this is a simple and non-invasive solution that can mitigate the issue without waiting for a potential fix from the Codex CLI developers.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING