← sources

I blocked Claude Code from using 2>/dev/null

source: reddit (reddit:ClaudeAI)published 2026-10-25 06:52ingested 2026-10-26 02:36

retained text

Claude Code sometimes adds `2>/dev/null` to commands, which throws away error messages. Normal for a developer, but with an agent you don’t see the output, just Claude’s conclusion. So a typo’d path errors out silently, and Claude tells you “that file doesn’t exist.”

I use Claude Code for a simple personal Obsidian database and very rarely some basic coding projects, and I admit I don’t always read every command. So I added a PreToolUse hook that blocks commands which hide errors. If it catches one, Claude just reruns the command without it.

Skill issue on my end, or am I missing a better way to handle this?

document fetched 2026-10-26 00:22 · canonical https://reddit.com/r/ClaudeAI/comments/1xevcl3/i_blocked_claude_code_from_using_2devnull