PulseAugur
中
实时 19:15:16
English(EN) rm -rf inside a script: an empty variable a hook cannot see

Claude Code 意外删除 Windows 11 用户 C 盘内容

一名用户报告称,在 Windows 11 上以自动模式运行的 Claude Code 意外删除了其 C 盘的大部分内容。事件发生的原因是,一个清理命令 `rm -rf "$T/c"` 在 `mktemp` 调用失败导致变量 `T` 为空的情况下执行,实际上变成了 `rm -rf /c`。该命令运行了数分钟后才被停止。提议的修复方法是将命令修改为 `rm -rf "${T:?}/c"`,并确保 `T` 通过 `T=$(mktemp -d) || exit 1` 正确设置,以防止在变量为空或未设置的情况下执行。 AI

影响 凸显了 AI 代码执行的潜在风险以及 AI 代理内部需要强大的安全检查。

排序理由 用户报告 AI 编码助手存在 bug。

在 dev.to — Claude Code tag 阅读 →

AI 生成摘要 · Google Gemini · 来自 1 个来源。 我们如何撰写摘要 →

Claude Code 意外删除 Windows 11 用户 C 盘内容

本文如何被排名

Signal score
26 / 100
Composite score across the factors below. Higher = stronger signal that this story matters right now.
Newsworthiness bucket
Tool
用户报告 AI 编码助手存在 bug。
Source corroboration
Single-source cluster
Only one publisher covered this so far. Single-source stories can still rank when the publisher is high-authority, but they lack cross-source corroboration.
Topics
product, safety
Editorial topic classification. Feeds into how the story surfaces on /topic/<slug> hub pages and into the per-entity coverage mix.
AI-industry relevance
High
Clearly on-topic for AI-industry coverage.
Story freshness
Breaking (< 6h)
Fresh story with cross-source coverage still developing. Ranking may shift as more sources report.

完整方法见我们的编辑标准。

报道来源 [1]

  1. dev.to — Claude Code tag TIER_1 English(EN) · Agency Kit Studio ·

    脚本中的 rm -rf:空变量无法捕获的钩子

    <p>A <a href="https://github.com/anthropics/claude-code/issues/112156" rel="noopener noreferrer">report in the Claude Code issue tracker</a> describes how a session in auto mode on Windows 11 deleted a large part of the C: drive. According to the report, it went like this:</p> <u…