Incorrect 'project override exists' message when running from home directory
Description
Claude Code v2.0.28 incorrectly reports that a project agent override exists when running from the home directory, even though no .agent-definitions/ directory exists anywhere in the filesystem.
Environment
- Claude Code Version: 2.0.28
- Platform: macOS (Darwin 24.6.0)
- Working Directory:
/Users/jim(home directory, not a git repository) - Date: November 17, 2025
Expected Behavior
When a personal agent is defined in ~/.claude/agents/feature-implementer.md, Claude Code should recognize it as a global/personal agent and not report it as a project-specific override.
Actual Behavior
Claude Code reports that a project agent override exists for feature-implementer, even though:
- No
.agent-definitions/directory exists in the current directory - No
.agent-definitions/directory exists anywhere in the home directory tree - The only agent file is the personal agent at
~/.claude/agents/feature-implementer.md
Evidence
Debug Logs
From the most recent debug log, the system correctly identifies 0 project agents:
[DEBUG] Loaded 0 unique skills (managed: 0, user: 0, project: 0, duplicates removed: 0)
[DEBUG] Found 0 plugins (0 enabled, 0 disabled)
[DEBUG] Total plugin agents loaded: 0
File System Search
Comprehensive search for .agent-definitions/ directories returned no results:
- No
.agent-definitions/in current working directory - No
.agent-definitions/in home directory tree (searched 4 levels deep) - Only agent file exists at:
~/.claude/agents/feature-implementer.md
Directory Structure
~/.claude/
├── agents/
│ └── feature-implementer.md (personal agent - correct location)
├── CLAUDE.md
├── settings.json
└── [other config files]
Reproduction Steps
- Define a personal agent in
~/.claude/agents/<agent-name>.md - Navigate to home directory:
cd ~ - Run Claude Code from home directory
- Observe that Claude Code reports a project override exists when it shouldn't
Root Cause Hypothesis
The bug appears to be in the user-facing messaging layer rather than the internal agent resolution logic (since debug logs show correct counts). Possible causes:
- Path resolution logic may be misidentifying home directory agents as project overrides when running from home
- The message generation code may not properly distinguish between personal and project agents when
pwdis the home directory
Impact
Users cannot distinguish between actual project overrides and personal agents when running from their home directory, leading to confusion about agent configuration and potential unnecessary troubleshooting.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗