#Prompt Request
1 messages · Page 1 of 1 (latest)
I can help with the Codex part of your question, but I'm only able to provide information about OpenAI products — I can't assist with prompts for Claude Code (an Anthropic product).
For OpenAI Codex: Using AGENTS.md for Context Files
The recommended approach in Codex is to use AGENTS.md files to provide persistent, targeted context so Codex doesn't need to re-scan your entire project each time. Here's how to structure this:
1. Global guidance (~/.codex/AGENTS.md)
# Developer Defaults
- Always read `CONTEXT.md` in the current working directory before starting any task.
- Prefer `rg` or `rg --files` for searching files — it is much faster than `grep`.
- Do not scan the entire project; use routing guidance below to find relevant files.
- After completing a task, update `CONTEXT.md` with any new conventions, file locations, or pitfalls discovered.
2. Repo-level context file (repo-root/AGENTS.md)
# Project Routing Guide
- Core logic: `src/core/`
- Utilities and helpers: `src/utils/`
- Shared components: `src/shared/`
- Workflows: `src/workflows/`
- Tests: `tests/`
# Known Pitfalls
- [Update this section after each session with issues found]
# Tech Stack
- [List your stack here so Codex doesn't probe for it]
3. Ask Codex to maintain a CONTEXT.md file
You can prompt Codex like this:
Before starting, read CONTEXT.md if it exists. After completing this task, update CONTEXT.md with:
- Any new files or modules you discovered
- Conventions or patterns you observed
- Any pitfalls or decisions made
Keep CONTEXT.md concise and structured.
Why this works
AGENTS.mdfiles are injected near the top of the conversation before your prompt, in root-to-leaf order, so Codex has routing guidance immediately. [Custom instructions]- You can add directory-specific
AGENTS.mdfiles so Codex only reads what's relevant to the current working directory. [Customization] - When Codex makes repeated mistakes or reads too many files, the docs explicitly recommend adding routing guidance to
AGENTS.mdspecifying which directories/files to prioritize. [Customization] - You can also enable Memories (where available) so Codex automatically carries useful context from prior threads forward without you needing to re-type it. [Memories]
Tip: Treat
AGENTS.mdas a feedback loop — when Codex reads too broadly, add routing rules and ask it to updateAGENTS.mdso future sessions inherit the fix. [Customization]