Cmd. /init
Generate an AGENTS.md scaffold for persistent repository instructions.
Key takeaways
- Generate an AGENTS.md scaffold for persistent repository instructions.
- Check the input surface and availability before using the examples below.
Purpose
Generate an AGENTS.md scaffold for persistent repository instructions.
/initAvailability
| Field | Value |
|---|---|
| Input surface | Running CLI prompt |
| Kind | Built-in |
| Status | Current reference |
| Aliases | — |
| Documented minimum | Not specified |
| Reviewed against | 2026-09-22 · Codex CLI 0.155.1 |
The installed command menu and account or organization settings determine availability.
Examples
/initWhen to use it
- Run
/initat the repository root before writing team-specific Codex guidance. - Edit the generated
AGENTS.mdto include test commands, coding standards, and safety rules.
Choosing related 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 |
Effects and persistence
Starts creation or updating of project instructions. Review the proposed file contents and project scope.
/init creates an AGENTS.md scaffold in the current directory so future Codex sessions can load
repository-specific instructions.
Cautions
- Treat the generated file as a scaffold, not a finished policy.
- Keep instructions concise and maintainable; stale instructions are worse than missing instructions.
Official sources
Complete command list · Verification scope · History for this command