We begin a Codex CLI session by entering codex in our terminal. The CLI automatically detects the project structure and initiates an interactive dialogue.
Codex CLI reads AGENTS.md from the project root at the start of every session, making our preferences and instructions persistent across conversations. The file can hold coding style, project conventions, and commands Codex should know about, such as how to run tests. Keeping it in the project root means every session starts already calibrated, with no need to re-explain how we work.
# AGENTS.md## Conventions- Use descriptive variable names.## Commands- Run tests with `pytest`.
/initWe can generate a starter AGENTS.md with /init, which analyzes the project and produces a first draft to refine. The /status command confirms which configuration files Codex CLI has loaded for the session. Together, /init gets the configuration started and /status verifies Codex is actually picking it up.
In a prompt, we use @ to point Codex at a specific file — for example, @spec.md — so it works from exact context instead of searching the whole project. The ! prefix runs a shell command inline, like !node --test, executing it directly without routing the request through Codex. Together they let us control both the context Codex sees and the commands we run, right from the prompt.
Review @spec.md and tell me what is missing.! node --test
A “next” workflow captured in AGENTS.md tells Codex to find the first unchecked item in our spec file, implement just that item, and mark it complete. Because the steps live in AGENTS.md, we can move through an entire feature list with a single instruction instead of re-explaining the process each session. The spec says what to build; the workflow says how to step through it.
## Next Task WorkflowWhen I say "do the next task":1. Read `spec.md`.2. Find the first unchecked item.3. Implement only that item.4. Mark it complete in `spec.md`.5. Stop for review.
With the interview technique, we ask Codex to question us before it generates any code or spec. Those answers let it tailor the output to our experience level, preferences, and the project’s actual requirements, rather than guessing. It’s especially useful for turning a vague idea into concrete requirements, since the questions surface details we might not have thought to specify.
Ask me questions about the utility we are building.After I answer, turn my answers into a spec.md checklist.
Codex CLI is a terminal-based AI coding agent that works directly in our environment. Rather than just returning suggestions to copy-paste, it reads our project files and runs commands on our behalf, taking concrete action in the workspace. Thinking of it as a pair programmer in the terminal, rather than a chatbot, captures how it’s meant to be used.