[BUG] Custom commands fail to load when user has ripgrep config with hyperlinks or forced colors
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude Code fails to load custom slash commands (from ~/.claude/commands/) when the user has a ripgrep configuration that enables hyperlinks or forces color output.
Environment:
- Claude Code v2.0.76
- macOS (Darwin)
- iTerm2 terminal
Steps to Reproduce:
- Create a ripgrep config file (e.g., ~/.ripgreprc or custom path)
- Add either or both of these settings:
--color=always
--hyperlink-format=default
- Set RIPGREP_CONFIG_PATH to point to this file in your shell config
- Create a custom command in ~/.claude/commands/save.md
- Start Claude Code
- Observe debug log shows: Failed to read/parse markdown file
Debug Log Output:
2025-12-31T05:02:20.575Z [DEBUG] Total plugin commands loaded: 0
2025-12-31T05:02:20.597Z [DEBUG] Failed to read/parse markdown file:
]8;;file://bigmac.lan/Users/paulbrower/.claude/commands/save.md/Users/paulbrower/.claude/commands/save.md
The file path contains OSC 8 hyperlink escape sequences, causing ENOENT errors.
Root Cause:
Claude Code uses ripgrep internally and inherits the user's RIPGREP_CONFIG_PATH environment variable. When ripgrep outputs file paths with escape sequences (hyperlinks or colors), Claude Code's parsing fails.
Suggested Fix:
When invoking ripgrep internally, Claude Code should either:
- Pass --no-config to ignore user configuration
- Explicitly pass --color=never --hyperlink-format= to override user settings
- Strip ANSI/OSC escape sequences from parsed output
Workaround:
Users must change their ripgreprc to use --color=auto instead of --color=always and remove/comment out --hyperlink-format=default.
What Should Happen?
When invoking ripgrep internally, Claude Code should either:
- Pass --no-config to ignore user configuration
- Explicitly pass --color=never --hyperlink-format= to override user settings
- Strip ANSI/OSC escape sequences from parsed output
Error Messages/Logs
Failed to read/parse markdown file
Steps to Reproduce
- Create a ripgrep config file (e.g., ~/.ripgreprc or custom path)
- Add either or both of these settings:
--color=always
--hyperlink-format=default
- Set RIPGREP_CONFIG_PATH to point to this file in your shell config
- Create a custom command in ~/.claude/commands/save.md
- Start Claude Code
- Observe debug log shows: Failed to read/parse markdown file
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.76
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
see description
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗