Skip to content

Local project .codex directory support #3706

Closed

Description

@moveforward01

What feature would you like to see?

add support for a .codex directory in the root of the project so you can have local project specific mcp settings and custom prompts/slash commands.

Are you interested in implementing this feature?

No response

Additional information

No response

Activity

  1. added
    enhancement
    on Sep 16, 2025
  2. djliden commented on Sep 16, 2025

    @djliden

    Agreed, I would find project-specific prompts especially useful.

  3. dgnsrekt commented on Sep 19, 2025

    @dgnsrekt

    This feature is critical to me and my workflow. Codex is entirely useless for me without it. Here is a little demo with the feature built in. If someone wants to improve on what I've done, then merge it in.
    https://github.com/Fomo-Driven-Development/claude-codex

  4. smaccoun commented on Sep 20, 2025

    @smaccoun

    Coming from claude code I'm surprised this isn't implemented. While I found sub-agents nearly useless (despite trying hard to make them useful) I find project level custom slash commands pretty core to my workflows (i had 10+ i regularly used in claude code)

  5. o1lo01ol1o commented on Oct 3, 2025

    @o1lo01ol1o

    Same. This is basically necessary for all nix projects that have non-trivial toolchains that must be available for the mcp.

  6. etraut-openai commented on Nov 9, 2025

    @etraut-openai
    Contributor

    This is related to #2554.

  7. marked .codex per project #3839 as a duplicate of this issue on Nov 11, 2025
  8. darrendukes commented on Nov 11, 2025

    @darrendukes

    per-repo mcp servers and /prompts are used heavily in very large enterprise repos. Experience from GitHub copilot says I need this capability to keep hundreds of engineers working on a repo on the right work flow.

  9. changed the title [-]local project .codex directory support[/-] [+]Local project .codex directory support[/+] on Nov 14, 2025
  10. noname-oni commented on Dec 11, 2025

    @noname-oni

    It becomes hard to manage codex prompts, config, skills from a single global location. Please add local .codex folder support.

  11. clearfram3 commented on Dec 13, 2025

    @clearfram3

    I made a feature-request that was rightly closed to consolidate things. Sharing the details here to further the discussion:
    ...
    .codex/prompts/ Works exactly as currently supported. This is just a namespaced, repo-local location.

    .codex/rules/ Equivalent to Cursor Rules, so file-based rules that are activated via glob patterns and are contextual and scoped. This lets Codex apply guidance where relevant, without polluting global context.

    .codex/skills/ Instead of requiring one folder per skill, allow both files and folders. This keeps simple skills in a single file, while more complex ones can include specific data, files, or examples relevant to the skill.

    .codex/skills/
      design-feature.md
      ci/
        README.md
        examples/
        skill.md
    

    .codex/docs/ This is a lightweight alternative to docs-focused MCPs. There are two possible ways to support it: either a folder of relevant documentation files (e.g., the complete Convex rules file) or a single file that links to documentation pages and includes descriptions, hints, and usage context (like skills and prompts do right now).

    Option 1 could go even further by including a description file (like Option 2), but using local files instead of web search. Both options would let Codex decide which docs to consult and load them selectively, based on descriptions or glob-based activation (similar to Cursor rules). This would simplify documentation grounding without needing external tools.

  12. added
    agent
    on Dec 14, 2025
  13. aaronclong commented on Dec 17, 2025

    @aaronclong

    It would great if there was just one location for all these like the AGENTS.md standard:

    I really wish a standard emerges that all these plugins supported like .prompts/**/*.md

  14. coreycoto commented on Dec 26, 2025

    @coreycoto

    You can now add skills to projects. Codex will pick up .codex folders nested in a git repo.

    https://x.com/embirico/status/2002126655133987009

  15. clearfram3 commented on Jan 1, 2026

    @clearfram3

    Skills should have a manual_only metadata flag. It would remove the need for a command/prompts folder completely. When true the skill is excluded from the agent's skill list preventing unintended use, but still present in the skill search provided by $ and remains invocable of course ($skill-name). When $$ is entered, the skill list should be filtered to only those that are manually invocable.

  16. coreycoto commented on Jan 9, 2026

    @coreycoto

    This now works for $REPO_ROOT/.codex/skills and the documentation is updated. Thanks @embirico and team!

    I've started to invest in Codex Rules to improve the development experience for working in my repo. It would be awesome to be able to commit these rules along side my skills.

  17. scops commented on Jan 10, 2026

    @scops

    I’m working with Codex across multiple repositories and have encountered real usability pain due to the current handling of the .codex directory.

    Right now, unless CODEX_HOME is explicitly exported, Codex always defaults to $HOME/.codex, even when there is a .codex folder present in the project. This forces me to manually update environment variables for each project, and when switching contexts I often need to re‑login or reset auth context, which interrupts workflows.

    I’ve implemented a shell wrapper to approximate a more useful behavior (in your .bashrc):

    codex() {
      local dir="$PWD"
      local used_path=""
      local GREEN="\033[0;32m"
      local YELLOW="\033[0;33m"
      local CYAN="\033[0;36m"
      local RESET="\033[0m"
    
      while [[ "$dir" != "/" ]]; do
        if [[ -d "$dir/.codex" ]]; then
          used_path="$dir/.codex"
          echo -e "${CYAN}[codex]${RESET} Using project-local .codex at ${GREEN}$used_path${RESET} (.bashrc)"
          export CODEX_HOME="$used_path"
          command codex "$@"
          return
        fi
        dir="$(dirname "$dir")"
      done
    
      used_path="$HOME/.codex"
      echo -e "${YELLOW}[codex]${RESET} Using global .codex at ${GREEN}$used_path${RESET} (.bashrc)"
      export CODEX_HOME="$used_path"
      command codex "$@"
    }

    This works, but it’s a workaround: the underlying client should natively detect .codex in the current project and prefer it automatically. It also has the annoying side effect of requiring a re-login

    Ideally, Codex should support a hierarchical resolution where:

    • it checks for a .codex directory in the current working directory or project root
    • if not found, it checks parent directories
    • if still not found, it falls back to $HOME/.codex

    This behavior is common in many developer tools and would significantly improve multi‑project workflows.

    Relevant related discussions:

  18. paulozoom commented on Jan 14, 2026

    @paulozoom

    Adding in a request to support project-level allow/deny tool calls. I’d like to configure our project to pre-allow safe calls for common shell, git and gh commands, to the benefit of every developer and worktrees. Claude Code allows this in a .claude/settings.json with allow / deny keys, and it’s rather useful.

  19. etraut-openai commented on Jan 24, 2026

    @etraut-openai
    Contributor

    This should now work if you're using the Codex CLI. You can define a project-local .codex/config.toml file and specify project-specific settings like MCP servers. One caveat: project-local config.toml files are ignored if the project is not trusted.

    We're still working on plumbing this feature through for the Codex IDE Extension. I'll keep this thread open until that's complete.

    We don't plan to add support for project-local custom prompts because we are going to deprecate that feature. We recommend using the newer "skills" feature which provides a superset of the custom prompt functionality. Project-local skills are already supported.

  20. noname-oni commented on Jan 25, 2026

    @noname-oni

    We don't plan to add support for project-local custom prompts because we are going to deprecate that feature.

    Are you planning to deprecate global prompts support as well?
    I mean wouldn't it be inconsistent if project-local configs gonna work with skills and config.toml, but not with prompts?

  21. etraut-openai commented on Jan 25, 2026

    @etraut-openai
    Contributor

    Are you planning to deprecate global prompts support as well?

    Yes, that's the plan.

  22. etraut-openai commented on Jan 26, 2026

    @etraut-openai
    Contributor

    This will be included in the next release of the IDE Extension! As I mentioned above, it has been implemented in the CLI for the past few releases.

  23. added
    config
    and removed
    agent
    on Apr 11, 2026
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

    configenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions