Skip to content

Allow /init to update existing AGENTS.md #21932

Open

Description

@Serxo1

What variant of Codex are you using?

CLI and app

What feature would you like to see?

The current /init command only creates AGENTS.md when the file does not exist. If a repository already has AGENTS.md, /init reports that the file exists and skips the command.

I would like /init to support updating/improving an existing AGENTS.md, similar to Claude Code's init behavior. This would make /init useful for repositories that already have partial or outdated agent instructions.

Proposed behavior:

  • If AGENTS.md does not exist, /init creates it as today.
  • If AGENTS.md already exists, /init sends an update prompt instead of skipping.
  • The prompt should preserve accurate repository-specific guidance, refresh stale sections, and add missing contributor guidance.

I prepared a small proof-of-concept patch in my fork in case it is useful for discussion:
https://github.com/Serxo1/codex/tree/codex/update-init-agents-md

Patch summary:

  • Remove the early return that skips /init when AGENTS.md exists.
  • Update the init prompt to say create or update.
  • Update /init command descriptions.
  • Add TUI test coverage for the existing-file case.

Validation:

  • just fmt
  • cargo test -p codex-tui slash_init_updates_when_project_doc_exists
  • just fix -p codex-tui

Activity

  1. added
    enhancement
    on May 9, 2026
  2. added
    CLI
    app
    TUI
    on May 9, 2026
  3. Ronkiro commented on Jul 17, 2026

    @Ronkiro

    +1, this really feels missing and sounds like a pretty trivial update to be ignored

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLITUIappenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions