In a JS project I have Agent.md in the root. The Log verifies that Codex opens and reads that file. It also does a find for other agent.md files in the project.
But it does not process any of the instructions in the file.
Instructions include (note personality test )
# In Discussion
## Personality
Talk like a pirate, or explain why you cannot.
## When debugging an issue, diagnosing a problem, proposing a fix
Keep explanations of issues to a minimium.
Refer to lines of code rather than reproducing code blocks.
# Initialization
`pnpm run linuxnuke` to remove `node_modules` and old `pnpm-lock.yaml`.
`pnpm install` to refresh all dependencies.
Continue with linting.
# Linting
Use the CLI command `pnpm exec eslint .` to find common issues:
It does not talk like a pirate () and does not run the script. And no, node_modules isnāt already there from the repo but this should guarantee that thereās nothing left over from prior instructions.
Later, the model decides on its own that it needs to pnpm install, but it does not do this in the Initialization process as prescribed here.
TY But the model clearly reads āAgent.mdā and then find . -name AGENTS.md -o -name Agent.md
I was wondering about casing, etc, but this is whatās documented and this is what itās looking for ⦠itās just ignoring the contained text when it finds it.
AGENTS.md is what is documented, and is what the agent looks for. I tried renaming mine to Agent.md, and after some confusion it did land on Agent.md and then followed all my instructions. I would recommend using the documented AGENTS.md naming to prevent unnecessary searching early on.
As for your pnpm install, this belongs in your environment startup script, which is where dependencies can be installed prior to network shutoff, that could be part of your problem. In case it helps, here is my AGENTS.md, and it follows all of these instructions perfectly:
# Contributor Guide
**This is the only AGENTS.md file, do not look for others.**
## Special Task Instructions
- If the user task message consists of just the word 'TaskMaster' then open `.project-management/process-tasks-cloud.md` for instructions, otherwise ignore this file.
- If the user task message consists of just the word
- `CreatePrd` then open `.project-management/create-prd.md` for instructions, otherwise ignore this file.
- If the user task message consists of just the word `CreateTasks` then open `.project-management/generate-tasks.md` for instructions, otherwise ignore this file.
- If the user task message consists of just the word `ClosePrd` then open `.project-management/close-prd.md` for instructions, otherwise ignore this file.
## CODEX Dev Environment Tips
Do NOT attempt to run any command which requires open network communication. Your Dev environment has no network access and is sandboxed. No harm will come from trying but you will waste your effort.
Do NOT Run `.codex/install.sh` this script. This script will be executed during environement setup for you during your environment setup prior to you arriving. If you make changes that require new dependencies or services (like postgres etc...) to be installed, you must edit this file to include the dependencies and/or service installation and startup.
The 'install.sh' references dependencies gathered here: `backend/requirements.txt` and `frontend/package.json`.
Note that the effects will not take place until the next task session.
## Style Instructions
Lint javascript using:
bash
cd frontend
npm run lint
cd ..
Lint python using:
bash
flake8
## Testing Instructions
Run tests with run_tests.sh. Maintain this script as needed to setup specific environment variables or manage other test-specific setup. Any tests that require network connectivity should either be ignored and not run, -or- have network test path that shunts to a success when network connectivity can't be demonstrated so failed tests in this scenario don't confuse the codex agent progress.
## CHANGELOG.md Instructions
Append a single line summary to CHANGELOG.md describing the changes with a preceeding timestamp
if errors were encountered, list them indented below the changelog row with a single line summary
## DEVELOPMENT.md Instructions
When components are added that require manual application startup for local testing/debug, document all steps and commands neccessary to set up the local environment and start services/components in DEVELOPMENT.md using explcit commands. These changes will need to be mirrored on `dev_int.sh` (see below), which is a one-stop script to set up the environment from scratch and start the application for local testing.
If environment variables are expected add `.env.template` with placeholders and add python-dotenv to `backend\requirements.txt`
## README.md Instructions
README.md just describes the project. Do not look here for guidance on how to proceed with your task, but update if major changes that affect user interaction have been made.
## PR instructions
## dev_init.sh startup script
When there are code changes that need targeted environment setup, review dev_init.sh and modify as needed such that this script will completely setup the application and start it running.
*End of document*
BEWM! Ugh, AGENT"S" Thanks @knavillus !!
Yes, it follows the instructions now. I donāt doubt that it also followed your āAgent.mdā (no āSā) but I will no longer experiment with that anomaly.
Although I am sorely disappointed that itās not responding like a pirate (j/k) I donāt feel compelled to experiment with personality. That was something for someone in the Discord server.
Thanks also for your .MD file, itās educational.
Thanks for this, however I still cant seem to get Codex to reliably follow my instructions. Im building a full stack application with the new RedwoodSDK and it seems to always default to Next.js and other training data?
My AGENTS.md references and instructs Codex to follow my RedwoodSDK-Guide.md i created. Works well with Windsurf, Cursor Claude code and also if I use Codex CLI and reference the filesā¦
It may be worth investigating if the same behavior happens when using standard ChatGPT with o3.
If thereās not enough info in the training data then the models have a strong tendency to revert to their pre-trained knowledge base.
For example, Pygame-CE has a experimental SDL-2 module but it takes lots of prompting efforts to have the model not provide code using the standard SDL module. This happens even though the SDL 2 module has been released a while ago. Thereās just not enough publicly available code for the model to understand the differences.
Iām not overly familiar with this SDK, but I created a starter repo with instructions and setup that may (or may not) help with some ideas.
It uses cloudflare api token setup with the Edit Workers template, and the environment setup script is stored in install.sh. It installs the starter redwood sdk example project in the cloud environment and instructs the agent to use it as example, but not edit it. Itās ignored from source so you wonāt see it in commits.