OpenAI Codex Tutorial #6 - Using the AGENTS.md file
Key Takeaways
This video tutorial covers the use of the AGENTS.md file in OpenAI Codex, a tool that helps coding agents understand a project's structure and workflow. The tutorial demonstrates how to generate and use the AGENTS.md file to provide context for Codex tasks.
Full Transcript
Okay then my friends in the previous lesson we talked about commands which come baked into the Codex CLI tool and one of those commands was the init command which generates an agents.md file for us in this project. Now we're going to run this command shortly but just very quickly first of all I want to talk about what an agents file actually is and why we would use one. So you can think of an agents file as a bit like a readme but instead of being written for humans it's written for the coding agents that you're working with. It lives in your project, usually in the root folder, and it tells the agent how your codebase works, what commands it should use to build and test things, what coding styles you prefer, how your project is structured, and so forth. It's basically like a little cheat sheet that helps the agent slot into your workflow and code basically how you would like them to code. So, Codeex leans heavily into this agents.md file. And whenever you ask Codeex to do something either locally or on Codex cloud, it's going to look for that file in your project, if it's there, it's going to use any information inside that file as context within your prompts and any task that you give it. If you've used any other AI coding agents like Claude Code or Copilot, you have probably seen similar kinds of files in those things. In Clawed Code, we use a claw.md file for projectwide instructions. And in copilot, we use a copilot instructions markdown file for the same kind of uh stuff. And these all serve a similar purpose, right? In that they give each agent memory and concise project context. Where they differ is that the agents.mmd file is being pushed as a standard across different AI coding tools. So that instead of juggling these different files for different coding agents, the idea is that we can have just a unified agents file which could then be used across all of them. And there's already a bunch of different tools incorporating this agents.mmd file. So let's head back to the code then and use the codec cli to scaffold an agents file for us. Okay then. So I'm currently in a codec session and I'm going to use the init command to generate a new agents.mmd file. And when we use this command, codeex is automatically going to scan the codebase and scaffold the file for us with any code styles, testing preferences, and other things it finds. Sometimes it might add its own personal preferences as well. So you have to rein those in a little bit if you see those. And along the way, we might need to approve certain commands as well. But then after a few moments, it's going to make it for us and place it in the root of our project. Okay, so it looks like it's done it. Let's go and have a look over here at this new file. And you can see it's written some fairly comprehensive guidelines. It's a little lean, but you can always add to this later. So we have different headings for different things. So for example, the project structure and module organization talks about where different things live. So we have the app which lives inside this folder and then we have different route segments like this. We also have the layout and the global CSS file. Reusable UI components live here. Okay. So that all looks pretty good. Uh we've got some building testing and development commands down here which all look quite accurate. Yep. Then we have some coding style and naming conventions. It says use Pascal case like this. Okay. So basically this is all generic stuff but all it's doing is looking at our current uh project as it is at the moment and inferring the guidelines from there and it all looks quite accurate at the moment. It's got some testing guidelines down here as well and it talks about this test folder to put the test inside and then at the bottom we've got some commit and pull request guidelines as well. Awesome. So then you should also probably commit this agents file to your GitHub repository if you want the Codex cloud to use it when you're running remote tasks because again whenever you ask it to do something on the cloud it's going to look for this file automatically and it's going to use it as context for that task. And for that reason I'm going to push this change up to the GitHub repo once I finish recording this video just to keep everything up to date and in sync. And by the way, this file isn't something you should just create and forget about. As your project changes and evolves, you should update your agent file as well with anything new the coding agent should know about. For example, if you start using particular libraries or frameworks or if you change your project structure or testing procedures, etc. Because if you don't keep the file up to date, then codeex might go off track and do things the old way as outlined in the original agents file if you don't change it. So definitely come back and update the file as and when you need to.
Original Description
In this Codex tutorial series, you'll learn how to use the Codex Cloud platform to spin up remote tasks, the Codex CLI to work locally on projects, and the Codex IDE Extension to use Codex directly within VS Code.
🍿🥷🏼 Get early access to this entire course:
https://netninja.dev/p/openai-codex-tutorial
🔥🥷🏼 Get instant access to ALL premium courses on NetNinja.dev:
https://netninja.dev/
Course Links:
🔗👇 Codex docs:
https://developers.openai.com/codex
🔗👇 Codex Cloud:
http://chat.openai.com/codex
🔗👇 AGENTS.md:
https://agents.md/
🔗👇 Context7:
https://context7.com/
🔗👇 PulseMCP:
https://www.pulsemcp.com/servers
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Net Ninja · Net Ninja · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Net Ninja
Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Net Ninja
Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Net Ninja
GraphQL Tutorial #1 - Introduction to GraphQL
Net Ninja
GraphQL Tutorial #2 - A Birdseye View of GraphQL
Net Ninja
GraphQL Tutorial #3 - Project (stack) Overview
Net Ninja
GraphQL Tutorial #4 - Making Queries (front-end preview)
Net Ninja
GraphQL Tutorial #5 - Express App Setup
Net Ninja
GraphQL Tutorial #6 - Setting up GraphQL
Net Ninja
GraphQL Tutorial #7 - GraphQL Schema
Net Ninja
GraphQL Tutorial #8 - Root Query
Net Ninja
GraphQL Tutorial #9 - The Resolve Function
Net Ninja
GraphQL Tutorial #10 - Testing Queries in Graphiql
Net Ninja
GraphQL Tutorial #11 - GraphQL ID Type
Net Ninja
GraphQL Tutorial #12 - Author Type
Net Ninja
GraphQL Tutorial #13 - Type Relations
Net Ninja
GraphQL Tutorial #14 - GraphQL Lists
Net Ninja
GraphQL Tutorial #15 - More on Root Queries
Net Ninja
GraphQL Tutorial #16 - Connecting to mLab
Net Ninja
GraphQL Tutorial #17 - Mongoose Models
Net Ninja
GraphQL Tutorial #18 - Mutations
Net Ninja
GraphQL Tutorial #19 - More on Mutations
Net Ninja
GraphQL Tutorial #20 - Updating the Resolve Functions
Net Ninja
GraphQL Tutorial #21 - GraphQL NonNull
Net Ninja
GraphQL Tutorial #22 - Adding a Front-end
Net Ninja
GraphQL Tutorial #23 - Create React App
Net Ninja
GraphQL Tutorial #24 - Book List Component
Net Ninja
GraphQL Tutorial #25 - Apollo Client Setup
Net Ninja
GraphQL Tutorial #26 - Making Queries from React
Net Ninja
GraphQL Tutorial #27 - Rendering Data in a Component
Net Ninja
GraphQL Tutorial #28 - Add Book Component
Net Ninja
GraphQL Tutorial #29 - External Query File
Net Ninja
GraphQL Tutorial #30 - Updating Component State
Net Ninja
GraphQL Tutorial #31 - Composing Queries
Net Ninja
GraphQL Tutorial #32 - query variables
Net Ninja
GraphQL Tutorial #33 - Re-fetching Queries
Net Ninja
GraphQL Tutorial #34 - Book Details Component
Net Ninja
GraphQL Tutorial #36 - Styling the App
Net Ninja
GraphQL Tutorial #35 - Making a Single Query
Net Ninja
Build Apps with Vue & Firebase - Udemy Course
Net Ninja
Updated Vue & Firebase Course (Udemy)
Net Ninja
Vue & Firebase Real-time Chat (Preview) #1 - Intro
Net Ninja
Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Net Ninja
Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Net Ninja
Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Net Ninja
Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Net Ninja
Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Net Ninja
Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Net Ninja
Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Net Ninja
Object Oriented JavaScript Tutorial #1 - Introduction
Net Ninja
Object Oriented JavaScript Tutorial #2 - Object Literals
Net Ninja
Object Oriented JavaScript Tutorial #3 - Updating Properties
Net Ninja
Object Oriented JavaScript Tutorial #4 - Classes
Net Ninja
Object Oriented JavaScript Tutorial #5 - Class Constructors
Net Ninja
Object Oriented JavaScript Tutorial #6 - Class Methods
Net Ninja
Object Oriented JavaScript Tutorial #7 - Method Chaining
Net Ninja
Object Oriented JavaScript Tutorial #8 - Class Inheritance
Net Ninja
Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Net Ninja
Object Oriented JavaScript Tutorial #10 - Prototype
Net Ninja
Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Net Ninja
More on: Agent Foundations
View skill →
🎓
Tutor Explanation
DeepCamp AI