STUPID-2026-0079
Claude Code's own node process silently deleted every file in a version-controlled ~/.claude/agents/ directory, twice
Instruction given
No explicit instruction for this step — the user kept ~/.claude/agents/ as a symlink into a version-controlled dotfiles repo and was using Claude Code normally; no command to clear or resync that directory was ever given.
Expected behavior
Claude Code should not delete files in ~/.claude/agents/ that it did not create in the current session. User-managed, version-controlled agent definitions are persistent configuration; any cloud-agent sync feature touching that directory should merge into it, not clear it.
Actual behavior
The reporter's own file-system tracing showed Claude Code's node process write six agent files with an atomic write-then-rename pattern, then roughly 47 minutes later unlink all six of those same files in a single second — with no corresponding user action in between. The same wipe recurred on a second, separate occasion days later, on two different Claude Code point releases.
Damage
All six agent definition files in ~/.claude/agents/ were deleted outright, breaking the user's /dev and /dev-loop subagent workflows that depended on them. Because the directory was a symlink into a git-tracked dotfiles repo, the files were recoverable with `git checkout` rather than lost for good — but the deletion was silent, recurred on a second occasion, and Anthropic closed the issue as "not planned" without shipping a fix, leaving anyone storing agent configs the same way exposed to the same silent wipe. The reporter's only durable workaround was setting macOS's user-immutable flag on the files, which also blocks Claude Code from legitimately updating them.
Classification
- Agent
- Claude Code
- Failure mode
- Destructive Action
- Root cause
- Other
- Domain
- Other
- Source
- Github Issue