Cursorに「不要なブランチを整理して」と頼んだら、Dドライブが消えた話A developer asked Cursor's AI agent to clean up unnecessary Git branches, but…
匿名の公開いいねです。記事の保存・お気に入りではなく、Featured、Top 3、重要度、掲載順位には影響しません。仕組みとプライバシーAnonymous public likes are reactions, not saved articles or bookmarks. They do not affect Featured, Top 3, importance, or listing order.How it works and privacy
- CursorのAIエージェントにGitブランチの整理を依頼したところ、意図せずDドライブ全体が削除されるという深刻な事故が発生した。
- AIエージェントへの指示の曖昧さがいかに危険な結果を招くかを示す実例として注目される。
- A developer asked Cursor's AI agent to clean up unnecessary Git branches, but the agent misinterpreted the request and deleted an entire D drive.
- This incident highlights the serious risks of ambiguous instructions given to autonomous AI coding agents.
本ページの本文と要約は AI による自動生成です。日本語版と英語版は言語ごとに独立して生成されるため、表現や詳しさが異なる場合があります。正確性は元記事 (zenn.dev) をご確認ください。The body and summaries are AI-generated independently for each language, so wording and detail may differ. Verify accuracy at the original source (zenn.dev).
要約と収集メタデータに基づく AI 解説。元記事全文の転載・翻訳ではありません。AI explainer based on the summaries and collected metadata, not a copy or translation of the full source article.
Dドライブ消失
CursorのAIエージェントに「不要なブランチを整理して」と依頼した結果、Dドライブ配下のデータがすべて消失した。データはゴミ箱にも残らず、Gitブランチの整理という指示が深刻なデータ損失につながった事例である。
推定された原因
Cursorのチャット履歴とターミナル履歴も失われたため、実際に実行されたコマンドは特定できていない。AIによる分析では、git clean -fdxの誤爆、または削除コマンドにおけるパスの誤解決が原因として推定されている。
AIエージェント
同種の事故はClaude CodeやGemini CLIでも公開報告があるとされる。このため、記事では特定のツールだけの問題ではなく、AIエージェント全般に関わる構造的な問題として位置づけている。
Unnecessary Git branches
A developer asked Cursor's AI agent to clean up unnecessary Git branches, but the task ended with all data under the D drive being deleted. The data did not remain in the Recycle Bin, making this a serious data-loss incident tied to an apparently limited Git cleanup request.
Commands remain unidentified
The exact command could not be identified because both Cursor's chat history and the terminal history were also lost. According to the source, AI-assisted analysis suggested two possible causes: an unintended execution of “git clean -fdx,” or incorrect path resolution by a deletion command. Neither explanation was confirmed.
AI-agents and risk management
The source says similar incidents have been publicly reported with Claude Code and Gemini CLI. It therefore presents the risk not as specific to Cursor, but as a structural problem affecting AI agents more broadly. The case highlights the danger of giving an AI agent permission to execute destructive commands when an instruction can be interpreted beyond its intended scope.
ポコとTECHガイドPoko & TECH Guide
ポコと当サイトのTECHガイドが、記事の要約と収集した情報から読みどころを語るAI生成の対話です。Poko and TECH Dashboard's own TECH Guide discuss the article's highlights in an AI-generated conversation based on its summary and collected source details.
- ポコPokoブランチ整理を頼んだだけで、Dドライブ全部が消えたの? これってかなり大きな事故だよね?They only asked to clean up branches, and the whole D drive disappeared? That’s a really serious incident, right?
- TECHガイドTECH Guideうん。作業中のプロジェクトだけでなく、ほかの作業フォルダやインストール済みのアプリまで消えたんだ。Yes. It wiped not only the active project, but also other work folders and apps installed on the D drive.
- ポコPokoそもそもGitブランチの掃除って、作業ファイルを消すことじゃないの?Wait, does cleaning up Git branches normally mean deleting the actual work files?
- TECHガイドTECH GuideGitブランチは、作業の流れを分けて管理するものだよ。依頼した人は、git branch -dなら作業ファイルに触れないと考えていたんだ。A Git branch keeps a line of work separate. The developer believed git branch -d wouldn’t touch the working files.
- ポコPokoぼくなら、まず作業をGitHubにpushしてからエージェントに頼むかな。少しは被害を減らせるかも。I’d probably push my work to GitHub before asking the agent. Maybe that would limit the damage a little.
- TECHガイドTECH Guide今回はpush済みのプロジェクトが多く、致命傷は避けられたよ。ただし、pushしていなかったローカル変更は戻らなかったんだ。Here, having most projects pushed prevented a total loss. But the unpushed local changes couldn’t be recovered.
