HaiAI123

Curated Global AI Tools Directory

Industry update
Flat

Developer uses 27-line hook to block rm -rf in Claude Code

11/27/2026 — 11/27, 04:16·1 sources (all)·1 reports (all)

Key takeaways

  • The author argues that "do not delete files" in CLAUDE.md is just an instruction that can be overridden in longer conversations, so they wro…

Background & analysis

On November 27, 2026, DEV Community published an article by a developer who built a PreToolUse hook for Claude Code in 27 lines of Node code to block recursive deletes such as rm -rf. The author argues that a line in CLAUDE.md telling the agent never to delete files is only an instruction: it is followed most of the time, but a later request or a long conversation can override it, and "most of the time" is not good enough for a delete. According to the post, Claude Code passes each tool call to the hook as JSON before executing it, and if the hook returns deny, the command does not run. The code uses no external packages. The author says every command listed in the article was tested against the hook before publication, and that the format was checked item by item against the Claude Code hooks documentation dated November 26. The account stops there: the material reports no further developments beyond the developer's own release and testing of the hook.

AI-generated from 1 reports · updated 2 days ago

Related AI tools

updream
24-hour heatHeat index 25 · peak 37 · 23h ago
24 hours agonow

Reports on this story headlines open the original

Nov 27
  1. A developer argues that "never delete files" in CLAUDE.md is only an instruction that can be overridden or lost in a long chat, so they built a 27-line dependency-free Node PreToolUse hook instead: Claude Code passes each tool call as JSON and a "deny" answer stops the command no matter what the conversation said. The author says the code was run against every command in the post's table before publishing and checked against the Claude Code hooks reference on 26 November 2026.

    DEV Community · AIAI score 60

Other stories people are talking about

How is heat calculated?About the method

Heat counts how many independent sources covered a story in the last 48 hours: one source counts once no matter how many posts it published, decaying with a 24-hour half-life. What ranks first is what many people are talking about.

This page aggregates public feeds. Headlines and summaries are machine-organized and remain the property of the original authors; verify important facts at the source. If you believe a headline or summary infringes your rights, email the contact address in the footer with the page URL and basis of your claim, and we will remove or replace it after review.

Surge
Discussion rising fast
New
First report within 6 hours
Rising
Still gathering discussion

Back to AI industry updates →