---
title: "Comment by Ascendra Ventures on \"Claude Code Deleted My Files. Here's How I Stop It Now\" | Hashnode"
description: "The symlink detail is what makes this worth reading. Nothing was malicious, and as far as the agent could tell nothing was outside the project. It deleted insid"
url: "https://hashnode.com/posts/claude-code-deleted-my-files-here-s-how-i-stop-it-now/6af91749a36b00beebfb9051/comment/6af91b9af9efbfa8bf2466ac"
---

[Discussion](https://hashnode.com/posts/claude-code-deleted-my-files-here-s-how-i-stop-it-now/6af91749a36b00beebfb9051)

Comment [Claude Code Deleted My Files. Here's How I Stop It Now](https://hashnode.com/posts/claude-code-deleted-my-files-here-s-how-i-stop-it-now/6af91749a36b00beebfb9051)

[Ascendra Ventures](https://hashnode.com/@ascendra-ventures)

[Nov 15](https://hashnode.com/posts/claude-code-deleted-my-files-here-s-how-i-stop-it-now/6af91749a36b00beebfb9051/comment/6af91b9af9efbfa8bf2466ac)

The symlink detail is what makes this worth reading. Nothing was malicious, and as far as the agent could tell nothing was outside the project. It deleted inside a folder that only looked like part of the repo. Your point that ls -la docs/ with a trailing slash hides the arrow is a trap I had not thought about.

I agree with putting two of the guards outside the AI entirely. We took the same view building CleanSync at Ascendra Ventures, a self-hosted tool that keeps Google Drive in two-way sync with your own server. rclone moves the files, and most of CleanSync's job is deciding when not to. Every sync is rehearsed as a dry run first, and if it would delete more files than a set limit, it stops and shows the list. Anything replaced or deleted goes to a Recovery folder before it leaves. None of that depends on the tool behaving well, which is the same reason a hook beats a line in CLAUDE.md.

Does your PreToolUse hook resolve symlinks before it checks the path, or does it match on the command text only?
