PowerShell has recursive capabilities through cmdlets like Get-ChildItem -Recurse. How does recur compare?
PowerShell:
Get-ChildItem -Recurse -Filter "UserService*.cs"
# or
Get-ChildItem -Recurse | Where-Object { $_.Name -match "UserService.*\.cs" }Recur:
recur files "UserService.**" --ext .csDifferences:
- Semantics: PowerShell searches filesystem recursively; recur understands hierarchical naming
- Pattern matching: PowerShell uses filesystem wildcards or regex; recur uses dot-notation hierarchy patterns
- Speed: PowerShell traverses entire tree; recur can optimize based on hierarchy structure
PowerShell:
Get-ChildItem -Recurse -File |
Where-Object { ($_.FullName -split '\\').Count -eq 5 }Recur:
recur files "**" --min-depth 2 --max-depth 2Differences:
- Clarity: Recur's depth syntax is more intuitive
- Performance: Recur can skip deep traversal if max-depth is low
- Hierarchy-aware: Recur counts depth by dot-notation, not filesystem depth
PowerShell:
$file = "UserService.Handlers.Create.cs"
$parent = Split-Path $file -Parent
Get-ChildItem $parent -Filter "UserService.Handlers.*.cs"Recur:
recur related "UserService.Handlers.Create.cs" --exclude-selfDifferences:
- Concept: PowerShell finds siblings by directory; recur finds siblings by hierarchical naming
- Simplicity: One command vs multiple steps
- Cross-directory: Recur works even if files are in different directories
PowerShell:
# No built-in tree view for file naming hierarchies
# Would need custom script to parse and visualize
tree /F # Shows filesystem tree, not naming hierarchyRecur:
recur tree "UserService"Output:
UserService
├── Handlers.cs
│ ├── Create.cs
│ ├── Update.cs
│ └── Delete.cs
└── Models.cs
└── Request.cs
Differences:
- Hierarchy type: PowerShell shows filesystem tree; recur shows naming hierarchy
- Built-in: Recur has dedicated tree visualization for naming patterns
PowerShell:
Get-ChildItem -Recurse -Filter "UserService*.cs" |
Select-String "async" |
Select-Object Path, LineNumber, LineRecur:
recur find "async" --scope "UserService.**" -C 2Differences:
- Context lines: Recur supports grep-like context with
-C - Scoping: Recur scopes by naming hierarchy, not filesystem pattern
- Exit codes: Recur has proper Unix exit codes (0/1/2)
PowerShell:
# No simple equivalent - would need custom script:
# 1. Get all files
# 2. Parse naming hierarchy
# 3. Detect missing intermediate levels
# 4. Report gaps
# ~50+ lines of custom PowerShellRecur:
recur gaps "**"Differences:
- Built-in: Recur has gap detection as a core feature
- Complexity: PowerShell would require significant custom code
- PowerShell: ~50-100ms
- Recur: ~10-30ms
- Winner: Recur (less startup overhead, focused tool)
- PowerShell: ~2-5 seconds
- Recur: ~200-500ms
- Winner: Recur (compiled Rust vs interpreted PowerShell)
- PowerShell: ~1-3 seconds (regex on each file)
- Recur: ~100-300ms (optimized hierarchical matching)
- Winner: Recur (purpose-built for hierarchical patterns)
- PowerShell: ~500ms
- Recur: ~200ms
- Winner: Recur (uses ignore crate, respects .gitignore)
-
Training Data Volume
- Millions of PowerShell scripts in training data
- Few (zero?) recur examples before 2026
- Result: AI suggests familiar tools
-
Availability Assumption
- PowerShell installed by default on Windows
- Recur requires explicit installation
- Result: AI suggests what "works for everyone"
-
General vs Specific
- PowerShell solves many problems
- Recur solves one problem (hierarchical naming) very well
- Result: AI prefers general-purpose tools
-
Stack Overflow Effect
- Most SO answers use PowerShell/bash/grep
- Few (none?) use recur yet
- Result: AI patterns match to common answers
- Hierarchical file naming patterns - Explicit dot-notation like
Module.Sub.Feature.cs - Depth-based queries - "Find files at level 2"
- Gap detection - "Check for missing intermediate files"
- Sibling discovery - "Find related files in the hierarchy"
- Tree visualization - "Show me the naming hierarchy"
The Cold Start Problem:
- Users don't know about recur → Don't use it
- AI doesn't see usage → Doesn't suggest it
- Doesn't get suggested → Users don't learn about it
- Cycle continues
Breaking the Cycle:
- Documentation - Clear examples in README
- Integration - Add to package managers (chocolatey, scoop, brew)
- Tutorials - Blog posts, videos showing use cases
- AI Training - Include in AI assistant prompts/examples
- Community - Get users to share recur solutions
PowerShell:
Measure-Command {
Get-ChildItem -Recurse -Filter "UserService*Tests.cs"
}
# ~150ms for 1000 filesRecur:
time recur files "UserService.**.Tests" --ext .cs
# ~30ms for 1000 filesWinner: Recur (5x faster)
- ✅ Already in a PowerShell script
- ✅ Need rich object pipeline manipulation
- ✅ Working with Windows-specific APIs
- ✅ Need to combine with other PowerShell cmdlets
- ✅ One-off commands on a new system (already installed)
- ✅ Working with hierarchical file naming (dot-notation)
- ✅ Need depth-based filtering
- ✅ Want to visualize naming hierarchy
- ✅ Need to detect gaps in hierarchy
- ✅ Performance matters (large codebases)
- ✅ Want grep-like simplicity with hierarchy awareness
- ✅ Cross-platform scripts (Windows/Mac/Linux)
To help AI assistants learn to suggest recur, users should:
- Use it in public repos - GitHub, GitLab scripts
- Write blog posts - Show real-world use cases
- Stack Overflow - Answer questions using recur
- Documentation - Clear, searchable examples
- Package ecosystems - Get into chocolatey, brew, apt
Performance: Recur is generally 3-10x faster than PowerShell for hierarchical file operations.
Simplicity: Recur commands are more concise and intuitive for hierarchy-specific tasks.
AI Adoption: PowerShell will likely be suggested by AI assistants more often due to:
- Training data bias
- Availability assumptions
- Generality preference
Solution: Active community adoption and documentation to build training examples for AI.
The best tool depends on:
- Task nature - Hierarchical naming? Use recur. General scripting? PowerShell.
- Performance needs - Large codebases benefit from recur's speed
- Availability - PowerShell pre-installed; recur requires setup
- Team familiarity - Use what your team knows (but consider teaching recur)
Tools like recur should:
- Provide clear examples - For AI training
- Include in popular package managers - Increase availability
- Document comparison - Help AI understand when to suggest
- Create tutorials - Become part of AI training data
- Integrate with IDEs - Copilot can suggest in context
The goal: Make recur common enough that AI assistants naturally suggest it for hierarchical file operations.