anthropics / anthropics/claude-code

[Bug] Desktop app Claude Code tab: inline \( ... \) math silently fails above 58 characters

Open
#94,787 3 comments 0 reactions 0 assignees View on GitHub
area:desktop area:ui bug has repro
Dominant language
Python
Stars
145k
Forks
23.1k
PR merge metrics
PR metrics pending

Description

**Environment:** Claude Code tab, Claude desktop app, macOS (Darwin 25.6.0), 2026-09-16.

**Summary:** An inline `\( ... \)` math span whose content exceeds 58
characters is not rendered. It degrades silently to bare parentheses around the
raw LaTeX source — no error, no visible delimiter — because Markdown reduces
`\(` to `(`. Display math `$$ ... $$` is unaffected at any length.

**Reproduction.** Each line differs from the one above it by a single
character. L58 renders; L59 does not.

```
\( \mathbb{Z} = abcdefghijabcdefghijabcdefghijabcdefghijabcde \)
\( \mathbb{Z} = abcdefghijabcdefghijabcdefghijabcdefghijabcdef \)
```

**Expected:** both render as math.
**Actual:** the first renders; the second appears as `( \mathbb{Z} = abcdef... )`.

**Threshold:** 58 characters of content between the delimiters. Including `\(`,
`\)` and the padding spaces the span is 64 characters; content plus padding is
60. Both suggest a bounded quantifier in the span-matching regex.

**What was ruled out.** Twenty variants isolating `\left` / `\right`, `\bigl` /
`\bigr`, plain parentheses, the number of `=` signs, repeated `\sqrt`, an
apostrophe in the span, list-item versus top-level context, and the presence of
a second span on the same line. Each is irrelevant; only source length predicts
the failure.

**Impact.** This lands hardest on exactly the mathematics that needs the most
care. A span such as
`v_{2}(a^{2}) = 2 v_{2}(a) \neq 1 + 2 v_{2}(b) = v_{2}(2b^{2})` is 61
characters and vanishes. Worse, it penalises correct typesetting: thin spaces
(`\,`), braced subscripts (`k_{i}` rather than `k_i`) and `\left` / `\right`
all consume budget, so the formatting that makes an expression legible is what
pushes it over the limit. The failure is silent, so a document can ship with
equations rendered as raw source without the author noticing.

**Suggested fix:** remove the bound, or if a bound is required for performance,
raise it substantially and make an over-length span render visibly as source
rather than as bare parentheses.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the L58/L59 boundary in the Claude Code tab on macOS, then locate the inline-math span matching and Markdown handling used by the desktop app. Check how over-length spans are processed and verify that both examples render as math, or that an over-length span remains visibly marked as source rather than becoming bare parentheses.

Written by the indexing model from the issue text.

Assessment

Tech stack
latex
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.