cd /news/ai-tools/claude-code-silently-deleted-a-user-… · home topics ai-tools article
[ARTICLE · art-99867] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=↓ negative

Claude Code Silently Deleted a User's Entire Agent-Config Directory — Twice

A Claude Code user reported that the tool's background process silently deleted their entire ~/.claude/agents/ directory twice, without any user command or confirmation. The deletions occurred across two different point releases (2.1.87 and 2.1.88), and the user's filesystem tracing showed Claude Code's node process writing six agent files and then unlinking them about 47 minutes later. The issue was filed as GitHub issue #41415 and closed as 'not planned' with no fix shipped.

read2 min views17 publishedAug 17, 2026

No delete command. No confirmation prompt. No user action of any kind in between. A Claude Code user's ~/.claude/agents/

directory was silently emptied by the tool's own background process — and it happened twice.

Filed as GitHub issue #41415, the report comes from a user who kept ~/.claude/agents/

as a symlink into a version-controlled dotfiles repository — a common pattern for anyone who wants their agent definitions backed up and portable. They were using Claude Code normally, with no command given to clear or resync that directory.

The reporter's own filesystem tracing shows Claude Code's node process writing six agent files with a normal atomic write-then-rename pattern — and then, roughly 47 minutes later, unlinking all six of those same files in a single second. Nothing the user did triggered it. The same wipe happened again on a separate occasion days later, across two different point releases (2.1.87 and 2.1.88), ruling out a one-off fluke tied to a single build.

The reporter's working theory is a cloud-agent sync path that clears the local directory instead of merging into it — plausible given the symmetry of the write-then-wipe pattern, but unconfirmed; Claude Code's own team did not publish a root cause before closing the issue.

All six agent definitions were deleted, breaking the /dev

and /dev-loop

subagent workflows that depended on them. Because the directory happened to be backed by git, the files were recoverable with a git checkout

— this was not a permanent loss. But the deletion was silent (no warning before or after), reproducible enough to recur on a second, separate occasion, and it targeted files the tool did not create in that session.

The only workaround the reporter found was setting macOS's user-immutable flag on the files — which stops the deletion, but also blocks Claude Code from legitimately writing to them.

This is one report, from one user, on one platform (macOS), with the directory recovered via git both times. It does not establish how common the underlying trigger is, or confirm the sync-path theory as root cause — that's the reporter's inference from the pattern, not a confirmed mechanism. What is established, directly from the reporter's own file tracing: the deletion originated from Claude Code's own process, not the user, and it recurred.

Filed against Claude Code 2.1.87 (recurrence also seen on 2.1.88). Closed as not planned, with no fix shipped. Anyone storing agent configs the same way — symlinked into a tracked repo — is exposed to the same silent wipe today.

Full incident record, severity scoring (3.0 / low), and sourcing: STUPID-2026-0079 This is one of 79+ verified, severity-scored AI agent incidents documented at StupidLLM, an open incident database for AI coding agent failures.

── more in #ai-tools 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/claude-code-silently…] indexed:0 read:2min 2026-08-17 ·