
Windows Safe Grep
- 9 installs
- 142 repo stars
- Updated February 3, 2026
- julianromli/opencode-template
Helps with ai & agent building tasks.
About
windows-safe-grep is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.
- windows-safe-grep
- AI & Agent Building
- AI-coding skill
Windows Safe Grep by the numbers
- 9 all-time installs (skills.sh)
- Ranked #12,074 of 16,556 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 3, 2026 (Skillselion catalog sync)
npx skills add https://github.com/julianromli/opencode-template --skill windows-safe-grepAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 9 |
|---|---|
| repo stars | ★ 142 |
| Last updated | February 3, 2026 |
| Repository | julianromli/opencode-template ↗ |
What it does
Helps with ai & agent building tasks.
Files
Windows-Safe Grep Skill
Problem
On Windows, paths containing backslash-space sequences (e.g., D:\Projects\Vibe Code\isometricid) can cause ripgrep to fail because:
- The
\ninisometricidis interpreted as a newline character - Combined with the following
ul, this creates a reference to the reserved Windows device namenul - Error:
rg: D:\Projects\Vibe Code\isometricid\nul: Incorrect function. (os error 1)
Solution
Use bash commands with proper path quoting to work around this Windows-specific issue:
Safe Grep Command Pattern
rg --fixed-strings "SEARCH_TERM" "/d/Projects/Vibe Code/isometricid"Or use forward slashes and proper quoting:
rg --fixed-strings "SEARCH_TERM" "$(cygpath -u "D:\Projects\Vibe Code\isometricid")"Alternative: Use find + grep
find "/d/Projects/Vibe Code/isometricid" -type f \( -name "*.ts" -o -name "*.js" -o -name "*.tsx" -o -name "*.jsx" \) -exec grep -H --line-number "SEARCH_TERM" {} \;Usage
When grep fails with "Incorrect function (os error 1)" on Windows:
1. Use this skill 2. Replace the path with forward slashes: D:\Projects\Vibe Code\isometricid → /d/Projects/Vibe Code/isometricid 3. Or use the bash command pattern with proper quoting
Example
rg --fixed-strings "polar_product_id" "/d/Projects/Vibe Code/isometricid/src"#!/bin/bash
# Windows-safe grep wrapper for OpenCode
# Usage: safe-grep "search_pattern" "windows_path_with_spaces"
SEARCH_PATTERN="$1"
TARGET_PATH="$2"
if [ -z "$TARGET_PATH" ]; then
# If no path provided, use current directory with forward slashes
TARGET_PATH="$(pwd)"
fi
# Convert backslashes to forward slashes for Windows paths
WIN_PATH=$(echo "$TARGET_PATH" | sed 's/\\/\//g')
# Use find + grep as a workaround since ripgrep may not be available
# This avoids the Windows path parsing issue in OpenCode's ripgrep tool
# Exclude .next directory for faster results
find "$WIN_PATH" -type f \( -name "*.ts" -o -name "*.js" -o -name "*.tsx" -o -name "*.jsx" -o -name "*.md" \) -not -path "*/.next/*" -not -path "*/node_modules/*" -exec grep -H --line-number -E "$SEARCH_PATTERN" {} \;