Home›Editor›Cursorに「不要なブランチを整理して」と頼んだら、Dドライブが消えた話

Cursorに「不要なブランチを整理して」と頼んだら、Dドライブが消えた話A developer asked Cursor's AI agent to clean up unnecessary Git branches, but…

元記事を読むRead original articlezenn.dev(新しいタブで開きます)(opens in a new tab)
AI2 点サマリ2 key points
  • 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.

  1. ポコPokoブランチ整理を頼んだだけで、Dドライブ全部が消えたの? これってかなり大きな事故だよね?They only asked to clean up branches, and the whole D drive disappeared? That’s a really serious incident, right?
  2. TECHガイドTECH Guideうん。作業中のプロジェクトだけでなく、ほかの作業フォルダやインストール済みのアプリまで消えたんだ。Yes. It wiped not only the active project, but also other work folders and apps installed on the D drive.
  3. ポコPokoそもそもGitブランチの掃除って、作業ファイルを消すことじゃないの?Wait, does cleaning up Git branches normally mean deleting the actual work files?
  4. 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.
  5. ポコPokoぼくなら、まず作業をGitHubにpushしてからエージェントに頼むかな。少しは被害を減らせるかも。I’d probably push my work to GitHub before asking the agent. Maybe that would limit the damage a little.
  6. TECHガイドTECH Guide今回はpush済みのプロジェクトが多く、致命傷は避けられたよ。ただし、pushしていなかったローカル変更は戻らなかったんだ。Here, having most projects pushed prevented a total loss. But the unpushed local changes couldn’t be recovered.
記事情報・収集記録Article details & collection record
出典Source
Zenn CursorコミュニティCommunity
公開日時 (JST)Published (JST)
収集日時 (JST)Collected (JST)
配信形式Format
ブログBlog
原文言語Source language
JA
重要度の位置づけImportance in this lane
MediumMedium priority(Editor 201件中、同等以上 158件)(158 of 201 Editor entries are equal or higher)
出典の平均重要度(掲載直近 30 件・最大 30 件)Source average (last 30 listed, up to 30)
2.0 / 31=情報 · 2=中 · 3=高1=Info · 2=Medium · 3=High
情報の寿命Half-life
中期 (チュートリアル)Medium-term (tutorial)

🖱️Editor の他の記事More from Editorもっと見る →View more →

ページ上部へScroll to top