[BUG] `$` in `$ARGUMENTS` and other variable names conflicts with math mode in Markdown

Resolved 💬 2 comments Opened Feb 16, 2026 by behrangsa Closed Mar 16, 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?

In GFM, and many other Markdown flavors, $ starts inline math mode, e.g. $x^2$ -> $x^2$.

But Claude Code uses $ARGUMENTS without the closing $ in custom slash commands.

This causes syntax highlighting in editors such as VS Code break.

What Should Happen?

Either support $ARGUMENTS$ (with the closing $) or another marker instead of $:

  • %ARGUMENTS%
  • ?ARGUMENTS?

Error Messages/Logs

Steps to Reproduce

Compare:

<img width="454" height="264" alt="Image" src="https://github.com/user-attachments/assets/6fc18314-9518-4490-ab6f-6fc3085fee46" />

with

<img width="454" height="264" alt="Image" src="https://github.com/user-attachments/assets/43f997b4-8e2e-4ff9-ad36-7c24414e7646" />

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.42

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

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