OpenAI Codex Tutorial #6 - Using the AGENTS.md file

Net Ninja · Beginner ·🛠️ AI Tools & Apps ·9mo ago

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 Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Net Ninja
2 Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Net Ninja
3 Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Net Ninja
4 GraphQL Tutorial #1 - Introduction to GraphQL
GraphQL Tutorial #1 - Introduction to GraphQL
Net Ninja
5 GraphQL Tutorial #2 - A Birdseye View of GraphQL
GraphQL Tutorial #2 - A Birdseye View of GraphQL
Net Ninja
6 GraphQL Tutorial #3 - Project (stack) Overview
GraphQL Tutorial #3 - Project (stack) Overview
Net Ninja
7 GraphQL Tutorial #4 - Making Queries (front-end preview)
GraphQL Tutorial #4 - Making Queries (front-end preview)
Net Ninja
8 GraphQL Tutorial #5 - Express App Setup
GraphQL Tutorial #5 - Express App Setup
Net Ninja
9 GraphQL Tutorial #6 - Setting up GraphQL
GraphQL Tutorial #6 - Setting up GraphQL
Net Ninja
10 GraphQL Tutorial #7 - GraphQL Schema
GraphQL Tutorial #7 - GraphQL Schema
Net Ninja
11 GraphQL Tutorial #8 - Root Query
GraphQL Tutorial #8 - Root Query
Net Ninja
12 GraphQL Tutorial #9 - The Resolve Function
GraphQL Tutorial #9 - The Resolve Function
Net Ninja
13 GraphQL Tutorial #10 - Testing Queries in Graphiql
GraphQL Tutorial #10 - Testing Queries in Graphiql
Net Ninja
14 GraphQL Tutorial #11 - GraphQL ID Type
GraphQL Tutorial #11 - GraphQL ID Type
Net Ninja
15 GraphQL Tutorial #12 - Author Type
GraphQL Tutorial #12 - Author Type
Net Ninja
16 GraphQL Tutorial #13 - Type Relations
GraphQL Tutorial #13 - Type Relations
Net Ninja
17 GraphQL Tutorial #14 - GraphQL Lists
GraphQL Tutorial #14 - GraphQL Lists
Net Ninja
18 GraphQL Tutorial #15 - More on Root Queries
GraphQL Tutorial #15 - More on Root Queries
Net Ninja
19 GraphQL Tutorial #16 - Connecting to mLab
GraphQL Tutorial #16 - Connecting to mLab
Net Ninja
20 GraphQL Tutorial #17 - Mongoose Models
GraphQL Tutorial #17 - Mongoose Models
Net Ninja
21 GraphQL Tutorial #18 - Mutations
GraphQL Tutorial #18 - Mutations
Net Ninja
22 GraphQL Tutorial #19 - More on Mutations
GraphQL Tutorial #19 - More on Mutations
Net Ninja
23 GraphQL Tutorial #20 - Updating the Resolve Functions
GraphQL Tutorial #20 - Updating the Resolve Functions
Net Ninja
24 GraphQL Tutorial #21 - GraphQL NonNull
GraphQL Tutorial #21 - GraphQL NonNull
Net Ninja
25 GraphQL Tutorial #22 - Adding a Front-end
GraphQL Tutorial #22 - Adding a Front-end
Net Ninja
26 GraphQL Tutorial #23 - Create React App
GraphQL Tutorial #23 - Create React App
Net Ninja
27 GraphQL Tutorial #24 - Book List Component
GraphQL Tutorial #24 - Book List Component
Net Ninja
28 GraphQL Tutorial #25 - Apollo Client Setup
GraphQL Tutorial #25 - Apollo Client Setup
Net Ninja
29 GraphQL Tutorial #26 - Making Queries from React
GraphQL Tutorial #26 - Making Queries from React
Net Ninja
30 GraphQL Tutorial #27 - Rendering Data in a Component
GraphQL Tutorial #27 - Rendering Data in a Component
Net Ninja
31 GraphQL Tutorial #28 - Add Book Component
GraphQL Tutorial #28 - Add Book Component
Net Ninja
32 GraphQL Tutorial #29 - External Query File
GraphQL Tutorial #29 - External Query File
Net Ninja
33 GraphQL Tutorial #30 - Updating Component State
GraphQL Tutorial #30 - Updating Component State
Net Ninja
34 GraphQL Tutorial #31 - Composing Queries
GraphQL Tutorial #31 - Composing Queries
Net Ninja
35 GraphQL Tutorial #32 - query variables
GraphQL Tutorial #32 - query variables
Net Ninja
36 GraphQL Tutorial #33 - Re-fetching Queries
GraphQL Tutorial #33 - Re-fetching Queries
Net Ninja
37 GraphQL Tutorial #34 - Book Details Component
GraphQL Tutorial #34 - Book Details Component
Net Ninja
38 GraphQL Tutorial #36 - Styling the App
GraphQL Tutorial #36 - Styling the App
Net Ninja
39 GraphQL Tutorial #35 - Making a Single Query
GraphQL Tutorial #35 - Making a Single Query
Net Ninja
40 Build Apps with Vue & Firebase - Udemy Course
Build Apps with Vue & Firebase - Udemy Course
Net Ninja
41 Updated Vue & Firebase Course (Udemy)
Updated Vue & Firebase Course (Udemy)
Net Ninja
42 Vue & Firebase Real-time Chat (Preview) #1 - Intro
Vue & Firebase Real-time Chat (Preview) #1 - Intro
Net Ninja
43 Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Net Ninja
44 Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Net Ninja
45 Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Net Ninja
46 Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Net Ninja
47 Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Net Ninja
48 Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Net Ninja
49 Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Net Ninja
50 Object Oriented JavaScript Tutorial #1 - Introduction
Object Oriented JavaScript Tutorial #1 - Introduction
Net Ninja
51 Object Oriented JavaScript Tutorial #2 - Object Literals
Object Oriented JavaScript Tutorial #2 - Object Literals
Net Ninja
52 Object Oriented JavaScript Tutorial #3 - Updating Properties
Object Oriented JavaScript Tutorial #3 - Updating Properties
Net Ninja
53 Object Oriented JavaScript Tutorial #4 - Classes
Object Oriented JavaScript Tutorial #4 - Classes
Net Ninja
54 Object Oriented JavaScript Tutorial #5  - Class Constructors
Object Oriented JavaScript Tutorial #5 - Class Constructors
Net Ninja
55 Object Oriented JavaScript Tutorial #6 - Class Methods
Object Oriented JavaScript Tutorial #6 - Class Methods
Net Ninja
56 Object Oriented JavaScript Tutorial #7 - Method Chaining
Object Oriented JavaScript Tutorial #7 - Method Chaining
Net Ninja
57 Object Oriented JavaScript Tutorial #8 - Class Inheritance
Object Oriented JavaScript Tutorial #8 - Class Inheritance
Net Ninja
58 Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Net Ninja
59 Object Oriented JavaScript Tutorial #10 - Prototype
Object Oriented JavaScript Tutorial #10 - Prototype
Net Ninja
60 Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Net Ninja

This tutorial teaches how to use the AGENTS.md file in OpenAI Codex to provide context for coding agents. It covers generating and updating the file, as well as using it to automate workflow tasks.

Key Takeaways
  1. Generate an AGENTS.md file using the Codex CLI init command
  2. Review and update the file to reflect project changes
  3. Use the file to provide context for Codex tasks
  4. Commit the file to a GitHub repository
  5. Update the file as the project evolves
💡 The AGENTS.md file serves as a standardized way to provide project context to coding agents, allowing for more efficient and accurate automation of workflow tasks.

Related Reads

Up next
How to Clean Up Your Backlog with AI & MCP | Businessmap Quick Tips
Businessmap
Watch →