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

  1. No error messages - Completely silent failure
  2. @ autocomplete - Only shows user agents (~/.claude/agents/), project agents don't appear
  3. /context command - Project agents section is completely missing (not empty, but absent)
  4. User agents work fine - All agents in ~/.claude/agents/ load correctly

Steps to Reproduce

  1. Create project agents in .claude/agents/*.md
  2. Start Claude Code in the project directory
  3. Wait for auto-compact to occur, OR restart Claude Code
  4. Run /context - project agents section is missing
  5. Try @ autocomplete - only user agents appear

Expected Behavior

  • Project agents should load from .claude/agents/
  • Should appear in /context output 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
  • /context shows 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

View original on GitHub ↗

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