Project agents not loaded - silent failure on startup and auto-compact
Resolved 💬 3 comments Opened Dec 15, 2025 by jung-wan-kim Closed Feb 14, 2026
Description
Project-level agents (.claude/agents/*.md) fail to load silently without any error messages. This issue occurs particularly after auto-compact or when restarting Claude Code.
Environment
- Platform: macOS (Darwin 24.5.0)
- Claude Code version: Latest
- Working directory: Consistent, no path changes
Symptoms
- No error messages - Completely silent failure
@autocomplete - Only shows user agents (~/.claude/agents/), project agents don't appear/contextcommand - Project agents section is completely missing (not empty, but absent)- User agents work fine - All agents in
~/.claude/agents/load correctly
Steps to Reproduce
- Create project agents in
.claude/agents/*.md - Start Claude Code in the project directory
- Wait for auto-compact to occur, OR restart Claude Code
- Run
/context- project agents section is missing - Try
@autocomplete - only user agents appear
Expected Behavior
- Project agents should load from
.claude/agents/ - Should appear in
/contextoutput under "Project" section - Should be available in
@autocomplete - If loading fails, should show an error message
Actual Behavior
- Project agents silently fail to load
- No error messages in any output
- Only user-level agents (
~/.claude/agents/) are recognized /contextshows all agents as "(User)" scope
Current Workaround
Moving all agents to user scope (~/.claude/agents/) works reliably.
Additional Context
This appears to be a loading order or initialization issue. The problem is more frequent after:
- Auto-compact events
- Claude Code restarts
- Long-running sessions
The silent failure makes debugging difficult - users don't know if:
- Agents aren't loaded
- Path is wrong
- File format is invalid
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗