[BUG] Only one personal agent loads - others incorrectly marked as duplicates
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When multiple personal agent files are placed in ~/.claude/agents/ or project agents in .claude/agents/, only one agent loads successfully. All subsequent agents are incorrectly skipped with the debug log message:
Skipping duplicate file '/path/to/agent.md' from userSettings (same inode already loaded from userSettings)
This happens even though the files have completely different inodes and are not symlinks or hardlinks. The deduplication logic appears to be broken - it marks ALL agents after the first one as "duplicates" regardless of their actual identity.
Note: The agent that successfully loads remains consistent across restarts as long as files are unchanged. However, when renaming files or modifying the agent directory, a different agent may become the one that loads while all others are still incorrectly skipped.
What Should Happen?
All properly formatted agent files in ~/.claude/agents/ (user agents) and .claude/agents/ (project agents) should load and appear in the /agents command output.
Error Messages/Logs
2025-12-28T11:02:49.413Z [DEBUG] Skipping duplicate file '/homes/user/.claude/agents/jira-manager.md' from userSettings (same inode already loaded from userSettings)
2025-12-28T11:02:49.415Z [DEBUG] Skipping duplicate file '/homes/user/project/.claude/agents/testing.md' from projectSettings (same inode already loaded from userSettings)
2025-12-28T11:02:49.417Z [DEBUG] Skipping duplicate file '/homes/user/project/.claude/agents/multi-tenant.md' from projectSettings (same inode already loaded from userSettings)
2025-12-28T11:02:49.418Z [DEBUG] Deduplicated 3 files in agents (same inode via symlinks or hard links)
2025-12-28T11:02:49.422Z [DEBUG] Total plugin agents loaded: 0
Actual inode verification shows all files have UNIQUE inodes:
$ ls -li ~/.claude/agents/
9278900238802621198 epic-picker.md
9278900238803359591 jira-manager.md
The debug log also shows this line at startup which may be related:
"Watching for changes in setting files /homes/user/.claude, /homes/user/.claude..."
(same path listed twice)
Steps to Reproduce
Create two agent files in ~/.claude/agents/:
File 1: ~/.claude/agents/agent-one.md
````
---
name: agent-one
description: First test agent
model: haiku
---
You are agent one.
File 2: ~/.claude/agents/agent-two.md
---
name: agent-two
description: Second test agent
model: haiku
---
You are agent two.
- Set permissions: chmod 600 ~/.claude/agents/*.md
- Start Claude Code: claude
- Run /agents command
- Only ONE agent appears in the list (the first one alphabetically)
- Check debug log - shows other agents "Skipping duplicate file... same inode already loaded"
Note: Tried renaming files, recreating with new inodes, changing permissions - none worked. Only having a single agent file works.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
unknown
Claude Code Version
2.0.76
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
iTerm2
Additional Information
What was tried (none fixed the issue):
- Renaming agent files
- Changing file permissions to 0600
- Recreating files to get new inodes
- Removing Claude Code and config and reinstalling
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗