Feature request: support lazy discovery of nested project skills

Open 💬 1 comment Opened Apr 26, 2026 by pnd280

What variant of Codex are you using?

CLI

What feature would you like to see?

Support automatic discovery of skills from nested .codex/skills/ directories, with zero upfront registration cost until the agent actually works in the relevant subtree.

The key behavior I’m asking for is not just “load skill bodies lazily.” It is lazy registration/discovery itself:

  • At session start, Codex should not inject metadata for every nested skill in a large repository.
  • When the agent starts working with files under a subtree, Codex should discover/register skills from that subtree, for example:
  • packages/frontend/.codex/skills/*/SKILL.md
  • packages/backend/.codex/skills/*/SKILL.md
  • Only after the relevant subtree is accessed should those skills’ names/descriptions/metadata become visible to the model.
  • Full skill content should still load only when the skill is invoked or otherwise selected.

This would make project-local skills scale much better for monorepos.

Example layout:

repo/
  .codex/skills/
    repo-wide-task/
      SKILL.md

  packages/
    web/
      .codex/skills/
        iconify/
          SKILL.md
        frontend-testing/
          SKILL.md

    api/
      .codex/skills/
        api-contracts/
          SKILL.md
        database-migrations/
          SKILL.md

Expected behavior:

  • If I start Codex at repo/, the prompt should not include metadata for every skill under every package.
  • If Codex works on packages/web/src/Button.tsx, it should discover/register packages/web/.codex/skills/*.
  • If Codex never touches packages/api, the API package’s skill metadata should never consume context.

Additional information

Claude Code has a similar concept documented as “Automatic discovery from nested directories”:

https://code.claude.com/docs/en/skills#automatic-discovery-from-nested-directories

The major benefit is context economy. In large monorepos, even skill metadata becomes expensive when every package contributes its own workflows, conventions, generators, review checklists, test procedures, and domain notes.

This feature changes the scaling behavior:

Before entering a package:
  context cost = 0 for that package's local skills

After working in that package:
  context cost = metadata for only that package's local skills

After invoking a skill:
  context cost = full instructions for only that skill

Without this, users have to choose between bad options:

  1. Put all package-specific guidance in global config and permanently bloat every session.
  2. Register all skills globally and pay metadata cost upfront.
  3. Omit package-specific skills and manually paste guidance when needed.

Nested lazy discovery gives package teams a way to ship local agent workflows without taxing unrelated work elsewhere in the repo.

Related but different concept: https://github.com/openai/codex/issues/19671

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗