Incorrect 'project override exists' message when running from home directory

Resolved 💬 3 comments Opened Nov 16, 2025 by jimmyp Closed Nov 20, 2025

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:

  1. No .agent-definitions/ directory exists in the current directory
  2. No .agent-definitions/ directory exists anywhere in the home directory tree
  3. 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

  1. Define a personal agent in ~/.claude/agents/<agent-name>.md
  2. Navigate to home directory: cd ~
  3. Run Claude Code from home directory
  4. 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 pwd is 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.

View original on GitHub ↗

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