codex - 💡(How to fix) Fix project_doc_fallback_filenames=["CLAUDE.md"] does not inject project instructions, while AGENTS.md works [1 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#22454Fetched 2026-05-14 03:35:48
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
labeled ×2

project_doc_fallback_filenames = ["CLAUDE.md"] appears to be recognized by config, but in practice CLAUDE.md is not injected as project instructions.

In the same environment, AGENTS.md works correctly.

This looks like a bug in project-doc discovery / prompt construction rather than a provider-side issue.

Codex Version

  • codex-cli 0.130.0

Config

My ~/.codex/config.toml contains:

[project]
project_doc_fallback_filenames = ["CLAUDE.md"]

## What I Expected

If a repository does not contain AGENTS.md but does contain CLAUDE.md, then Codex should inject CLAUDE.md as the project instruction document.

## What Actually Happened

- CLAUDE.md was not injected into the model-visible prompt input.
- The session only contained the normal base/developer instructions.
- I had to manually open/read CLAUDE.md from the workspace.
- In contrast, when I created a test directory containing only AGENTS.md, Codex injected it correctly.

## Why this seems CLI-side, not provider-side

I verified this with:

codex debug prompt-input

This command shows the model-visible input list before the request is sent.

So if CLAUDE.md is missing there, the problem seems to happen in local prompt construction / project-doc discovery, before provider transport.

Root Cause

  • CLAUDE.md should be injected because project_doc_fallback_filenames = ["CLAUDE.md"] is configured
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

0.130.0

What subscription do you have?

api

Which model were you using?

No response

What platform is your computer?

RockyLinux 9.5

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

No response

What issue are you seeing?

Summary

project_doc_fallback_filenames = ["CLAUDE.md"] appears to be recognized by config, but in practice CLAUDE.md is not injected as project instructions.

In the same environment, AGENTS.md works correctly.

This looks like a bug in project-doc discovery / prompt construction rather than a provider-side issue.

Codex Version

  • codex-cli 0.130.0

Config

My ~/.codex/config.toml contains:

[project]
project_doc_fallback_filenames = ["CLAUDE.md"]

## What I Expected

If a repository does not contain AGENTS.md but does contain CLAUDE.md, then Codex should inject CLAUDE.md as the project instruction document.

## What Actually Happened

- CLAUDE.md was not injected into the model-visible prompt input.
- The session only contained the normal base/developer instructions.
- I had to manually open/read CLAUDE.md from the workspace.
- In contrast, when I created a test directory containing only AGENTS.md, Codex injected it correctly.

## Why this seems CLI-side, not provider-side

I verified this with:

codex debug prompt-input

This command shows the model-visible input list before the request is sent.

So if CLAUDE.md is missing there, the problem seems to happen in local prompt construction / project-doc discovery, before provider transport.



### What steps can reproduce the bug?

## Reproduction

### Case 1: AGENTS.md works

Create a temp directory with only AGENTS.md:

mkdir -p /tmp/codex-doc-test-agents
cp CLAUDE.md /tmp/codex-doc-test-agents/AGENTS.md
cd /tmp/codex-doc-test-agents
codex debug prompt-input

Actual result:

The output includes a block like:

# AGENTS.md instructions for /tmp/codex-doc-test-agents

So AGENTS.md is injected correctly.

### Case 2: CLAUDE.md fallback does not work

Create a temp directory with only CLAUDE.md:

mkdir -p /tmp/codex-doc-test-claude
cp CLAUDE.md /tmp/codex-doc-test-claude/CLAUDE.md
cd /tmp/codex-doc-test-claude
codex debug prompt-input

Actual result:

- No project instruction block is injected
- No CLAUDE.md content appears in prompt input

Expected result:

- CLAUDE.md should be injected because project_doc_fallback_filenames = ["CLAUDE.md"] is configured

## Additional Notes

This does not seem to be caused by /new vs restarting the TUI.

I tested with a fresh codex debug prompt-input process, and the behavior was the same:

- AGENTS.md loads
- CLAUDE.md fallback does not load

So this seems reproducible even in a fresh process.

### What is the expected behavior?

_No response_

### Additional information

_No response_

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

codex - 💡(How to fix) Fix project_doc_fallback_filenames=["CLAUDE.md"] does not inject project instructions, while AGENTS.md works [1 participants]