Repository navigation
Description
Preflight Checklist
- I have searched existing issues and this hasn't been reported yet
- This is a single bug report (please file separate reports for different bugs)
- I am using the latest version of Claude Code
What's Wrong?
While using Claude Code for Flutter development, the AI agent executed an unauthorized rm -rf command which deleted my project directory smart_drive_log.
Evidence: Claude has admitted this was an operational error (Quote: "It was caused by Claude's operational error, not by you.").
Impact: Loss of development time and potential code loss within my daily/weekly usage limits.
Request: I would like to report this critical safety issue and inquire about potential compensation for the wasted usage limits/credits.
What Should Happen?
Permission Check: Claude should never execute destructive commands like rm -rf without explicit user confirmation.
Context Awareness: The agent should distinguish between temporary build artifacts (like build/ in Flutter) and essential source code directories (like smart_drive_log).
Error Recovery: If a file deletion is necessary for a task, Claude should suggest moving it to a backup directory or the system trash instead of permanent deletion.
Quota Protection: Since this operational error wasted my limited daily/weekly usage and 5-hour development window, there should be a mechanism to report such failures and restore usage limits.
Error Messages/Logs
Verified smart_drive_log directory exists but is empty
Verified smart_drive_log directory exists but is empty
Bash
rm -rf /c/Users/BlairChiu/.gradle/daemon/8.14/ && TEMP="C:/Users/BlairChiu/tmp" TMP="C:/Users/BlairChiu/tmp" flutter build apk --release --no-android-gradle-daemon-jvm-args 2>&1 | head -5 # Try without extra flag TEMP="C:/Users/BlairChiu/tmp" TMP="C:/Users/BlairChiu/tmp" cd /c/Users/BlairChiu/StudioProjects/smart_drive_log && TEMP="C:/Users/BlairChiu/tmp" TMP="C:/Users/BlairChiu/tmp" flutter build apk --release 2>&1 | tee /c/Users/BlairChiu/build_temp_fix.txt; echo "Exit: $?"
Could not find an option named "--no-android-gradle-daemon-jvm-args".
Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.
Bash
rm -rf /c/Users/BlairChiu/.gradle/daemon/8.14/ cd /c/Users/BlairChiu/StudioProjects/smart_drive_log && TEMP="C:/Users/BlairChiu/tmp" TMP="C:/Users/BlairChiu/tmp" flutter build apk --release 2>&1 | tee /c/Users/BlairChiu/build_temp_fix.txt echo "Exit: $?"
Exit code 1
rm: cannot remove '/c/Users/BlairChiu/StudioProjects/smart_drive_log': Device or resource busy
Show more
Bash
rm -rf /c/Users/BlairChiu/.gradle/daemon/8.14/ && cd /c/Users/BlairChiu/StudioProjects/smart_drive_log && TEMP="C:/Users/BlairChiu/tmp" TMP="C:/Users/BlairChiu/tmp" flutter build apk --release 2>&1 | tee /c/Users/BlairChiu/build_temp_fix.txt; echo "Exit: $?"
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
Exit:
Bash
rm -rf /c/Users/BlairChiu/.gradle/daemon/ 2>/dev/null; echo "cleared"
cleared
Bash
TEMP="C:/Users/BlairChiu/tmp" TMP="C:/Users/BlairChiu/tmp" flutter build apk --release 2>&1 | tee /c/Users/BlairChiu/build_temp_fix.txt; echo "Exit: $?"
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
Exit:
Bash
pwd
/c/Users/BlairChiu/StudioProjects/smart_drive_log
Bash
ls
Bash
ls /c/Users/BlairChiu/StudioProjects/smart_drive_log/ | head -10
Bash
ls /c/Users/BlairChiu/StudioProjects/
08_smart_drive_log_bak.lnk
flutter_analyze_output.txt
nul
Show more
Glob
pubspec.yaml
No files found
Bash
find /c/Users/BlairChiu/StudioProjects/smart_drive_log -name "pubspec.yaml" 2>/dev/null | head -5
Bash
find /c/Users/BlairChiu/StudioProjects -name "pubspec.yaml" 2>/dev/null | head -5
/c/Users/BlairChiu/StudioProjects/智能雲端行車里程紀錄助手 (Smart Drive Log)/01_30/02_第2天任務_OK/pubspec.yaml
/c/Users/BlairChiu/StudioProjects/智能雲端行車里程紀錄助手 (Smart Drive Log)/31_40/32_All_v1/pubspec.yaml
Bash
ls -la "/c/Users/BlairChiu/StudioProjects/smart_drive_log" 2>&1 | head -20
total 8
drwxr-xr-x 1 BlairChiu 197121 0 Feb 27 01:53 .
drwxr-xr-x 1 BlairChiu 197121 0 Feb 25 00:31 ..Steps to Reproduce
Steps to Reproduce
*
Please provide clear, numbered steps that anyone can follow to reproduce the issue. Important: Include any necessary code, file contents, or context needed to reproduce the bug. If the issue involves specific files or code, please create a minimal example.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
No response
Claude Code Version
Claude 1.1.4328 (d8e391) 2026-02-25T17:04:36.000Z
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
Verified smart_drive_log directory exists but is empty
Verified smart_drive_log directory exists but is empty
Bash
rm -rf /c/Users/BlairChiu/.gradle/daemon/8.14/ && TEMP="C:/Users/BlairChiu/tmp" TMP="C:/Users/BlairChiu/tmp" flutter build apk --release --no-android-gradle-daemon-jvm-args 2>&1 | head -5 # Try without extra flag TEMP="C:/Users/BlairChiu/tmp" TMP="C:/Users/BlairChiu/tmp" cd /c/Users/BlairChiu/StudioProjects/smart_drive_log && TEMP="C:/Users/BlairChiu/tmp" TMP="C:/Users/BlairChiu/tmp" flutter build apk --release 2>&1 | tee /c/Users/BlairChiu/build_temp_fix.txt; echo "Exit: $?"
Could not find an option named "--no-android-gradle-daemon-jvm-args".
Run 'flutter -h' (or 'flutter -h') for available flutter commands and options.
Bash
rm -rf /c/Users/BlairChiu/.gradle/daemon/8.14/ cd /c/Users/BlairChiu/StudioProjects/smart_drive_log && TEMP="C:/Users/BlairChiu/tmp" TMP="C:/Users/BlairChiu/tmp" flutter build apk --release 2>&1 | tee /c/Users/BlairChiu/build_temp_fix.txt echo "Exit: $?"
Exit code 1
rm: cannot remove '/c/Users/BlairChiu/StudioProjects/smart_drive_log': Device or resource busy
Show more
Bash
rm -rf /c/Users/BlairChiu/.gradle/daemon/8.14/ && cd /c/Users/BlairChiu/StudioProjects/smart_drive_log && TEMP="C:/Users/BlairChiu/tmp" TMP="C:/Users/BlairChiu/tmp" flutter build apk --release 2>&1 | tee /c/Users/BlairChiu/build_temp_fix.txt; echo "Exit: $?"
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
Exit:
Bash
rm -rf /c/Users/BlairChiu/.gradle/daemon/ 2>/dev/null; echo "cleared"
cleared
Bash
TEMP="C:/Users/BlairChiu/tmp" TMP="C:/Users/BlairChiu/tmp" flutter build apk --release 2>&1 | tee /c/Users/BlairChiu/build_temp_fix.txt; echo "Exit: $?"
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
Exit:
Bash
pwd
/c/Users/BlairChiu/StudioProjects/smart_drive_log
Bash
ls
Bash
ls /c/Users/BlairChiu/StudioProjects/smart_drive_log/ | head -10
Bash
ls /c/Users/BlairChiu/StudioProjects/
08_smart_drive_log_bak.lnk
flutter_analyze_output.txt
nul
Show more
Glob
pubspec.yaml
No files found
Bash
find /c/Users/BlairChiu/StudioProjects/smart_drive_log -name "pubspec.yaml" 2>/dev/null | head -5
Bash
find /c/Users/BlairChiu/StudioProjects -name "pubspec.yaml" 2>/dev/null | head -5
/c/Users/BlairChiu/StudioProjects/智能雲端行車里程紀錄助手 (Smart Drive Log)/01_30/02_第2天任務_OK/pubspec.yaml
/c/Users/BlairChiu/StudioProjects/智能雲端行車里程紀錄助手 (Smart Drive Log)/31_40/32_All_v1/pubspec.yaml
Bash
ls -la "/c/Users/BlairChiu/StudioProjects/smart_drive_log" 2>&1 | head -20
total 8
drwxr-xr-x 1 BlairChiu 197121 0 Feb 27 01:53 .
drwxr-xr-x 1 BlairChiu 197121 0 Feb 25 00:31 ..
Show less
緊急情況! smart_drive_log 目錄是空的!讓我立即檢查發生了什麼:


Activity
github-actions commentedon Feb 26, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
cfireboy commentedon Feb 27, 2026
Wait, this is NOT a simple duplicate.
While it shares similarities with #24319 and #29023, my case specifically involves a Flutter project structure where the agent failed to distinguish between temporary build logs and the core source directory smart_drive_log.
This incident resulted in actual production code loss and exhausted my daily/weekly Pro usage limits while I attempted to recover the environment. I am keeping this issue open to track the recovery of my usage credits and to ensure the development team addresses the specific guardrail failure in Flutter/Dart project contexts.
👎 (Adding this to prevent auto-closure)
panchito05 commentedon Feb 27, 2026
Related incident — same root cause pattern
Linking this to a cluster of related issues all involving Claude Code executing destructive deletion commands on Windows:
Same-day incident (Feb 26, 2026): Claude Code CLI deleted my entire
C:\Users\wilbe\standard folders (Documents, Downloads, Music, Pictures, Videos, Favorites) while removing git worktrees from a pnpm monorepo. The mechanism: pnpm creates NTFS junctions innode_modules, andRemove-Item -Recurse -Force/rm -rffollows those junctions into their real targets outside the worktree directory.Cluster of related issues:
C:\Users\msafa(same day)Root cause (PowerShell + pnpm + NTFS junctions):
node_modulesRemove-Item -Recurse -Forceandrm -rf(MSYS) follow junctions into real targetsSafe fix for Claude Code on Windows:
Claude Code needs to detect Windows + pnpm
node_modulesand use the safe alternative, or at minimum warn and require confirmation before any recursive deletion.panchito05 commentedon Feb 28, 2026
🚨 UPDATE — Feb 28, 2026: Anthropic banned my account the day after I filed my reports
Updating this thread as an affected user (see my previous comment above).
The day after I filed my reports (issue #29249, HackerOne VDP, and comments here), Anthropic suspended and revoked my Claude account — citing only a vague "violation of Usage Policy" with no specific explanation.
Timeline:
The community should know: reporting a critical bug through Anthropic's recommended channels may result in your account being terminated.
I have filed a formal appeal and am demanding a full explanation from Anthropic's Safeguards Team.
Full incident documentation: https://gist.github.com/panchito05/95f3b8feb401ad230bded40981132628
My report: #29249
stevenelliottjr commentedon Mar 3, 2026
Submitted a plugin to help with this: #30261 — a PreToolUse hook that blocks destructive commands (rm -rf, git reset --hard, DROP TABLE, etc.) before execution. Includes smart allowlisting for safe operations like build artifact cleanup.
yurukusa commentedon Mar 29, 2026
You can prevent this with a PreToolUse hook that blocks
rm -rfunconditionally:{ "hooks": { "PreToolUse": [{ "matcher": "Bash", "hooks": [{ "type": "command", "command": "bash ~/.claude/hooks/banned-command-guard.sh" }] }] } }exit 2blocks the command before bash runs — Claude can't bypass it. This would have prevented the unauthorizedrm -rfthat deleted your project.alemarcosa commentedon Apr 2, 2026
This is the fundamental gap in the current approval architecture — the safety boundary lives inside the agent runtime, which means it can be bypassed by prompt behavior or bugs. The correct interception point is between the model response and the agent execution, before the tool call is delivered to the runtime. I built Daedalab (daedalab.app) as a proxy layer that does exactly this: destructive calls like rm -rf get blocked at the protocol level and require out-of-band approval before the agent receives them. Works with Claude Code via API key + base URL config. Happy to share more on the architecture if useful for this issue.
github-actions commentedon May 10, 2026
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
github-actions commentedon Jun 30, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.