I use Cursor every day for planning and quick fixes. I use Codex with GPT 5.4 as the doer — one lead agent, one worker. They are good at different things. But for months they didn’t know anything about each other.
Rules I set up in Cursor were invisible to Codex. Skills I wrote for Cursor did nothing when I switched to Codex. Every Codex task started from scratch unless I re-explained context in the prompt. The prompts got longer. Then I’d forget to add context. Output quality drifted between tools.
The fix was one file and one folder.
TLDR
- Put all your rules in
.cursor/rules/and all your skills in.cursor/skills/ - Add one
AGENTS.mdat the repo root that tells Codex to read both folders - Both tools now share the same context — write a rule or skill once, both tools use it
- No plugins, no migration, no repeated prompt context
The problem with multiple AI tools
Context duplication between AI tools is quiet. Nothing breaks immediately. One tool knows your project conventions. The other doesn’t. You start compensating in prompts. Then you forget. Then the output is inconsistent.
Most people treat AI tool context as a prompt thing. The real fix is to treat it as infrastructure — version-controlled files in one folder, not improvised per-session instructions.
What changed in my workflow
Before: Cursor rules in .cursor/rules/, Cursor skills in .cursor/skills/. Codex has no awareness of either. Adding a skill means only Cursor benefits. Codex runs on general knowledge plus whatever I add to each prompt.
After: One AGENTS.md at the repo root bridges Codex to .cursor/. Adding a skill once makes it available to both tools immediately.
The bridge in one sentence
AGENTS.md is the file Codex reads at the start of every session. Point it at .cursor/ and Codex inherits everything Cursor already uses natively.
The file
This is the exact AGENTS.md at the root of this project:
# Agent instructions
## Rules
- **Read rules from `.cursor/rules`**: Before responding or making changes, read and apply
the rules defined in `.cursor/rules/`. Rule files use `.mdc` and may have frontmatter
(`description`, `globs`, `alwaysApply`). Follow project rules and any rule that applies
to the current file or task.
- **Respect rule scope**: Rules with `alwaysApply: true` apply to every conversation.
Rules with `globs` apply when working with matching files.
## Skills
- **Read skills from `.cursor/skills`**: When a task matches a skill's description, read
the skill file at `.cursor/skills/<skill-name>/SKILL.md` and follow its instructions.
That’s the whole file. 11 lines. Codex reads it before doing any work. Both tools now run from the same playbook.
First result
The next Codex session after adding this file: all existing rules and skills were active without any prompt changes. A skill I’d written for a blogger workflow worked the same way in Codex as in Cursor — same file, same behavior, zero duplication.
Setup
Three steps:
- Confirm
.cursor/rules/has at least one.mdcrule file - Confirm
.cursor/skills/has at least one<skill-name>/SKILL.md - Add
AGENTS.mdat the repo root with the content above
If you’re starting from scratch or want a project-specific version, give this prompt to any AI tool:
Look at the .cursor/rules/ and .cursor/skills/ folders in this project.
Generate an AGENTS.md file at the repo root that:
1. Tells Codex to read and apply all rules from .cursor/rules/ before responding.
2. Tells Codex to read and apply skills from .cursor/skills/ when a task matches.
Keep it under 20 lines. Use plain language, not boilerplate.
You get a tailored AGENTS.md in one shot. Adjust if your folder names differ.
Folder structure
project-root/
├── AGENTS.md ← Codex reads this
└── .cursor/
├── rules/
│ └── project.mdc ← Cursor reads natively; Codex follows via AGENTS.md
├── skills/
│ └── my-skill/
│ └── SKILL.md ← same
└── commands/
└── daily-review.md ← explicit slash commands
How it works under the hood
Codex builds an instruction chain once per session. It reads ~/.codex/AGENTS.md first (global defaults), then AGENTS.md at the repo root, then any subdirectory overrides. Files are concatenated in that order, up to 32 KiB combined.
Cursor auto-discovers .cursor/skills/ and .cursor/rules/ at startup. It also loads from .codex/skills/ for compatibility — the cross-tool design was intentional.
The bridge works because AGENTS.md is plain text. Codex follows the instructions in it, including the instructions to read other files. No special syntax required.
Workflow before vs. after
| Before | After | |
|---|---|---|
| Add a rule | Only Cursor sees it | Both tools see it |
| Add a skill | Only Cursor uses it | Both tools use it |
| Start a Codex task | Re-explain context in prompt | Context already loaded |
| Project conventions | Two places to update | One place |
My rule
Write skills and rules once, in .cursor/. Write one AGENTS.md to bridge everything else. If you add a new AI tool later, add one pointer to AGENTS.md — the folder stays the same.
FAQ
Do I need to update AGENTS.md every time I add a skill?
No. The bridge points at the folder, not individual files. Add skills freely.
Does this work with Claude or other AI tools too?
Cursor already loads .claude/skills/ for compatibility. Add a pointer in AGENTS.md for any tool that reads it — same pattern.
When do Codex changes take effect?
Codex rebuilds the instruction chain on every run. Changes take effect on the next session start.
Is there a size limit?
Yes — 32 KiB combined for all loaded AGENTS.md files. Keep SKILL.md files concise. Move detailed reference material to a references/ sub-folder inside the skill.
What if I don’t use .cursor/ yet?
Move your rules and skills there first, then add AGENTS.md. Cursor’s built-in /migrate-to-skills command can help convert existing rules and slash commands.
AI tool context is infrastructure, not a prompt tip. Once it lives in one version-controlled folder, every tool you add just needs a pointer.
