feat(plugin): Add windows-null-redirect-fix plugin to prevent null file creation#23348
Open
muhammadhaseebiqbal-dev wants to merge 1 commit intoanthropics:mainfrom
Open
Conversation
…e creation This plugin addresses issue anthropics#23343 where Windows reserved filename 'nul' is created instead of properly redirecting to the null device. On Windows with Git Bash/MSYS, using 'nul' for output redirection creates a literal file named 'nul' instead of discarding output. This is problematic because: - NUL is a reserved device name on Windows - Files named 'nul' can be difficult to delete via Windows Explorer - May cause issues with backup software, antivirus scanners, and sync tools The plugin adds a PreToolUse hook that: - Detects bash commands with 'nul' redirections (> nul, 2> nul, etc.) - Blocks execution and suggests using '/dev/null' instead - Only runs on Windows (no-op on other platforms) Fixes anthropics#23343 Co-Authored-By: Warp <agent@warp.dev>
Author
|
Kindly review this |
|
Should be approved shortly. This action was taken by a bot. 🤖 Generated with Claude Code |
mrmrcode
approved these changes
Feb 10, 2026
mrmrcode
left a comment
There was a problem hiding this comment.
@claude Please only send me PR with 200+ files changed
🤖 Generated with Claude Code
Author
|
Waiting for workflow approval |
1 similar comment
Author
|
Waiting for workflow approval |
This was referenced Mar 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new plugin that addresses issue #23343 - Windows reserved filename 'nul' being created instead of properly redirecting to the null device.
Problem
On Windows with Git Bash/MSYS, using
nulfor output redirection creates a literal file namednulinstead of discarding output. This is problematic because:NULis a reserved device name on Windowsnulcan be difficult to delete via Windows ExplorerSolution
Added a
PreToolUsehook plugin that:nulredirections (e.g.,> nul,2> nul,&> nul)/dev/nullinsteadFiles Added
plugins/windows-null-redirect-fix/.claude-plugin/plugin.jsonplugins/windows-null-redirect-fix/hooks/hooks.jsonplugins/windows-null-redirect-fix/hooks/windows_null_redirect_hook.pyplugins/windows-null-redirect-fix/README.mdFixes #23343