Cmd. /init
Generate an AGENTS.md scaffold for persistent repository instructions.
Key takeaways
/initcreates anAGENTS.mdscaffold in the current directory so future Codex sessions load repository-specific instructions.- Run it at the repository root, then edit the file to add test commands, coding standards, and safety rules.
- It makes repeated session context explicit and reviewable, which helps team onboarding.
- Treat the output as a scaffold, not a finished policy; keep instructions concise because stale guidance is worse than none.
Original Command Declaration
/initOfficial Summary
/init creates an AGENTS.md scaffold in the current directory so future Codex sessions can load
repository-specific instructions.
Usage
/initGood Examples
- Run
/initat the repository root before writing team-specific Codex guidance. - Edit the generated
AGENTS.mdto include test commands, coding standards, and safety rules.
Similar Commands
| Command | Difference | Choose It When |
|---|---|---|
/init | Creates persistent instruction scaffolding | The repo does not yet have Codex guidance |
/status | Shows current session state | You need to verify loaded context |
/mention | Attaches files to the current turn | You need one-off context |
Use Cases
- Bootstrapping repository instructions.
- Creating a starting point for team onboarding.
- Making repeated session context explicit and reviewable.
Cautions
- Treat the generated file as a scaffold, not a finished policy.
- Keep instructions concise and maintainable; stale instructions are worse than missing instructions.
Release Basis
- Judgment: first observed mention
- First evidence version:
rust-v0.28.0 - Date (UTC): 2025-09-02
- Release link: https://github.com/openai/codex/releases/tag/rust-v0.28.0
Sources
- Codex slash commands: https://developers.openai.com/codex/cli/slash-commands
- Codex CLI features: https://developers.openai.com/codex/cli/features