[BUG] Custom agents intermittently disappear from /agents picker — files on disk, not loaded (v2.1.69)
Preflight
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
Custom agent definitions in ~/.claude/agents/ intermittently fail to appear in the /agents picker. The files are confirmed present on disk — the picker simply doesn't load them.
Live repro in a single session:
- Opened
/agentspicker — showed 11 agents (6 custom + 5 built-in). All 6 custom agents visible. - Dismissed the picker.
- Opened
/agentspicker again seconds later — showed 8 agents (3 custom + 5 built-in). Three agents vanished:doc-owner,pipeline-orchestrator-5min,trading-algo-planner. - Confirmed all 6
.mdfiles still present in~/.claude/agents/vials -la. No file was deleted, renamed, or modified.
Directory listing at time of bug (all files present):
-rw-r--r-- 1 Cassie 197121 9577 Mar 4 16:02 1min-eod-pipeline-owner.md
-rw-r--r-- 1 Cassie 197121 11837 Mar 5 07:23 doc-owner.md
-rw-r--r-- 1 Cassie 197121 10562 Mar 5 07:42 pipeline-orchestrator-5min.md
-rw-r--r-- 1 Cassie 197121 30923 Mar 4 16:25 ram-safety-auditor.md
-rw-r--r-- 1 Cassie 197121 8754 Mar 5 07:42 trading-algo-planner.md
-rw-r--r-- 1 Cassie 197121 33010 Mar 4 16:25 wiring-auditor.md
Picker showing only 3 of 6:
User agents (C:\Users\Cassie\.claude\agents)
1min-eod-pipeline-owner · opus · project memory
ram-safety-auditor · opus
wiring-auditor · opus
Missing: doc-owner, pipeline-orchestrator-5min, trading-algo-planner
What Should Happen?
All .md files in ~/.claude/agents/ should always appear in the /agents picker. File discovery should be deterministic — opening the same picker twice in the same session should show the same results.
Steps to Reproduce
- Have 4+ custom agent
.mdfiles in~/.claude/agents/ - Open
/agentspicker — note all agents visible - Dismiss and reopen — some agents may be missing
- The specific agents that disappear seem random/non-deterministic
Environment
- Claude Code Version: 2.1.69
- Platform: Windows 11
- Runtime: Node.js v24.14.0 (npm install)
- Terminal: Windows Terminal / PowerShell
Additional Context
This appears related to the session rename persistence bug (#25090) — same pattern of data on disk but the UI index/listing mechanism failing to load it. The file discovery for agents may be using a cached directory listing or file watcher that intermittently misses entries.
Also observed: an agent created in the evening didn't show up in /agents at all. The next morning it appeared without any changes. The picker's file discovery is clearly non-deterministic.
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗