Agent discovery does not inherit from parent .claude/agents directories

Resolved 💬 3 comments Opened Mar 5, 2026 by sergio0p Closed Mar 9, 2026

Description

Claude Code currently only discovers agents in the current project's .claude/agents directory. Agents in parent directory .claude/agents folders are not inherited or discovered.

Expected Behavior

When working in a project (e.g., /Users/username/Dropbox/Teaching/Projects/LECWeb), Claude should discover and make available agents from parent directory .claude/agents folders (e.g., /Users/username/Dropbox/.claude/agents/), similar to how many tools inherit configuration from parent directories.

Current Behavior

Only agents defined in the current project's .claude/agents/ directory are accessible. Parent directory agents are completely ignored, requiring duplication of agent definitions across projects.

Example

Given this directory structure:

/Users/username/Dropbox/
├── .claude/
│   └── agents/
│       ├── canvas-latex-html.md
│       ├── dictation-cleanup.md
│       └── latex-converter.md
└── Teaching/
    └── Projects/
        └── LECWeb/
            └── .claude/
                └── agents/
                    └── sync-deploy.md

When working in LECWeb, only sync-deploy.md is available. The agents in /Dropbox/.claude/agents/ (canvas-latex-html, dictation-cleanup, latex-converter) are not discovered.

Impact

This forces users to either:

  1. Duplicate agent definitions across projects
  2. Manually move/copy agent files to each project
  3. Work around it with symlinks

Agent inheritance from parent directories would enable code reuse and simpler project organization.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗