Skip to content
Back to skills

En

ASecurity

Finds and deletes Windows-reserved NUL files created by using /dev/null in Git Bash. Headless or with GUI.

  • 6 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 4, 2026
ai-agentspythongoshellbashgitapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned September 28, 2026

npx -y skills add ellmos-ai/skills --skill en --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of En?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for En
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ellmos-ai-skills-55a5cdf3/badge)](https://www.skillsdirectory.com/skills/ellmos-ai-skills-55a5cdf3)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: nulcleaner
version: 1.0.0
type: tool
author: Lukas Geiger
created: 2026-03-12
updated: 2026-03-12
description: Finds and deletes Windows-reserved NUL files created by using /dev/null in Git Bash. Headless or with GUI.

standalone: true
anthropic_compatible: true
bach_compatible: true
bach_origin: true
category: utilities
tags: [windows, nul, cleanup, git-bash, filesystem]
language: en
status: active
dependencies: {'tools': [], 'services': [], 'protocols': [], 'python': []}
provenance: {'origin': 'bach', 'origin_path': 'system/tools/nulcleaner.py', 'origin_version': '1.0.0', 'origin_repo': 'github.com/ellmos-ai/bach', 'last_sync_from_origin': '2026-03-12', 'last_sync_to_origin': None, 'local_changes_since_sync': False}
---

<img src="../banner.png" width="100%" alt="nulcleaner banner">

> **English** — Official English version of `nulcleaner`.


# nulcleaner - Windows NUL File Cleanup

## The Problem

When `/dev/null` is used in commands under Git Bash on Windows (e.g., `> /dev/null`),
instead of redirecting to nowhere, an actual **file named `nul`** is created in the current
directory. Windows reserves "NUL" as a device name, which means these files cannot be
deleted normally.

This tool finds and deletes such NUL files via the extended UNC path (`\\?\`).

---

## Modes

| Mode | Description |
|------|-------------|
| `scan` | Recursively scan directory for NUL files |
| `delete` | Find and delete NUL files |
| `gui` | Graphical interface with file selection |

---

## CLI Usage

```bash
# Scan only (shows found NUL files) (Deutsch)
python nulcleaner.py scan /path/to/directory

# Scan and delete (Deutsch)
python nulcleaner.py delete /path/to/directory

# Start GUI mode (Deutsch)
python nulcleaner.py gui
```

---

## Headless API (for Integration)

The tool also provides a Python API for headless operation:

```python
from nulcleaner import clean_nul_files_headless

result = clean_nul_files_headless("/path/to/directory", verbose=True)
print(f"Found: {result['found']}, Deleted: {result['deleted']}")
```

**Return value:** `{'found': int, 'deleted': int, 'errors': list}`

---

## Technical Details

- Uses the extended UNC path (`\\?\`) to delete Windows-reserved filenames
- Recursive scan with `os.walk()`
- GUI with tkinter (no external dependencies)
- Only works on Windows (where the problem occurs)

---

## Prevention

Best to avoid `/dev/null` in Git Bash altogether. Instead:
- Simply omit the output
- Use `2>&1` for stderr redirection
- Pay attention to Windows compatibility in shell scripts

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…