[BUG] Custom commands fail to load when user has ripgrep config with hyperlinks or forced colors

Resolved 💬 3 comments Opened Dec 31, 2025 by lopperman Closed Feb 27, 2026

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:

  1. Create a ripgrep config file (e.g., ~/.ripgreprc or custom path)
  2. Add either or both of these settings:

--color=always
--hyperlink-format=default

  1. Set RIPGREP_CONFIG_PATH to point to this file in your shell config
  2. Create a custom command in ~/.claude/commands/save.md
  3. Start Claude Code
  4. 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

  1. Create a ripgrep config file (e.g., ~/.ripgreprc or custom path)
  2. Add either or both of these settings:

--color=always
--hyperlink-format=default

  1. Set RIPGREP_CONFIG_PATH to point to this file in your shell config
  2. Create a custom command in ~/.claude/commands/save.md
  3. Start Claude Code
  4. 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

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗