[BUG] Agent dedup drops all but one agent on virtual filesystems (Cryptomator/WinFsp) - && should be || in inode guard
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?
Bug: Agent dedup drops all but one agent on virtual filesystems (Cryptomator/WinFsp)
Summary
Claude Code's agent file deduplication silently drops all agent definitions except the first when files are on a virtual filesystem that reports ino = 0 (e.g. Cryptomator via WinFsp, VeraCrypt, network shares).
Environment
- Claude Code 2.1.266 (also reproduced on 2.1.263)
- Windows 11
- Agent definitions stored on a Cryptomator vault (WinFsp mount)
- 4 agent .md files in
$CLAUDE_CONFIG_DIR/agents/: architect.md, engineer.md, validator.md, researcher.md
Observed behavior
Only the first agent file enumerated (architect.md) loads. The other three are silently dropped. No error in the UI; the debug log shows Skipping duplicate file ... (same inode already loaded).
Root cause
The dedup function DQr in the bundle:
async function DQr(e) {
let n = await lstat(e, {bigint: true});
if (n.dev === 0n && n.ino === 0n) return null; // skip dedup
return `${n.dev}:${n.ino}`
}
On WinFsp/Cryptomator, every file reports ino = 0n but dev is nonzero (it's a mounted volume). So every file gets the identity 137085992:0, the first one is kept, and the rest are "duplicates".
The guard checks dev === 0n && ino === 0n (both zero), but should check dev === 0n || ino === 0n (either zero). When ino is zero the filesystem cannot distinguish files, so dedup should be skipped.
What Should Happen?
Suggested fix
if (n.dev === 0n || n.ino === 0n) return null;
One character: && to ||.
Affected scope
This affects not just agents/ but any directory loaded through the same LQr dedup path: .claude/agents/, .claude/commands/, and possibly others. Any user with agent definitions on a Cryptomator, VeraCrypt, Dokany, WinFsp, or network filesystem mount will hit this.
Error Messages/Logs
Steps to Reproduce
Verification
python -c "import os; [print(f'{n}: ino={os.lstat(f\"W:/Claude/agents/{n}.md\").st_ino}') for n in ['architect','engineer','validator','researcher']]"
Output: all ino=0.
Compare with NTFS:
python -c "import os; [print(f'{n}: ino={os.lstat(f\"C:/Users/Alex/Documents/Run/claude/agents/{n}.md\").st_ino}') for n in ['architect','engineer','validator','researcher']]"
Output: all unique nonzero inodes.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Claude Code 2.1.266
Platform
Other
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_