[BUG] Agent Definitions Remain Static Across Sessions
Resolved 💬 2 comments Opened Aug 2, 2025 by shawnsw Closed Aug 2, 2025
## Description
The Task tool's agent definitions remain static and don't reflect the actual filesystem state, even
across new conversation sessions. This causes Claude to suggest agents that have been deleted or
moved.
## Steps to Reproduce
- Move/delete agent files from
.claude/agents/ - Start a NEW Claude Code session
- Ask Claude to list available agents or use the Task tool
- Claude still shows the old, non-existent agents
## Expected Behavior
- Task tool should dynamically read available agents from the filesystem
- Agent list should reflect current
.claude/agents/directory structure - Should validate agent existence before listing/suggesting them
## Actual Behavior
- Task tool contains hardcoded agent definitions
- Deleted/moved agents still appear as available options
- New agents aren't discovered automatically
- This persists even after starting fresh sessions
## Environment
- Claude Code version: [your version]
- OS: macOS
- Model: Claude Opus 4
## Additional Context
This is particularly problematic during agent reorganization/refactoring, as the static definitions
become increasingly out of sync with reality.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗