[BUG] Chat Markdown rendering mutates meaning of content (renumbers ordered lists)

Status Open
Reported on v2.1.280
Maintainer reply None cached
Activity 0 comments · opened Sep 23, 2026

[BUG] Chat Markdown rendering mutates meaning of content (renumbers ordered lists)

Preflight Checklist

  • [x] I have searched existing issues and this has been reported before; this draft consolidates #87790 and #92855.
  • [x] This is a single bug report: the chat Markdown renderer changes the meaning of ordered-list references.
  • [x] This report is about a bug, not a feature request or support question.

What's Wrong?

The Claude Code chat/TUI Markdown renderer silently renumbers ordered-list markers in agent responses. For example, an agent may deliberately output 1., 5., 6., and 8. to refer back to items in the user's original numbered list, but the UI displays them as 1., 2., 3., and 4..

This changes the meaning of a conversational response. It is not merely a visual formatting issue: the raw agent response and the response shown to the user no longer say the same thing.

This is the same underlying issue reported in #87790, which was closed as not planned, and subsequently in #92855. Those reports describe the same defect with different occurrences or reproductions. This issue, #96268, is intended as a clear repost/consolidation of that bug.

Impact

  • User confusion: Users cannot reliably map the displayed references to the original numbered content.
  • Semantic corruption: Non-sequential references are silently changed to different numbers.
  • Apparent agent self-contradiction: The agent may deny writing a displayed number because the raw response and rendered response differ.

What Should Happen?

The chat/TUI should preserve literal ordered-list numbers when they carry conversational meaning. The raw response and the rendered response should remain semantically equivalent, while ordinary Markdown rendering should continue to work normally.

This should be fixed in the chat Markdown rendering layer used by the TUI/chat UI. It should not require changing user behavior, agent behavior, prompts, or system instructions. The renderer—not the user, the agent, or the instructions—should preserve the meaning of the original response.

Error Messages/Logs

No error is reported. The failure is silent content mutation during rendering.

Steps to Reproduce

  1. Ask the agent to output the following lines verbatim:

```text

  1. First
  2. Fifth
  3. Sixth
  4. Eighth

```

  1. Compare the raw assistant message, transcript data, or other source representation with the rendered response in the chat/TUI.
  2. Observe that the raw response contains 1., 5., 6., and 8., while the UI displays:

```text

  1. First
  2. Fifth
  3. Sixth
  4. Eighth

```

  1. In a real conversation, observe that a user can then ask about the displayed “2.” even though the agent wrote no “2.”. The agent may not understand the discrepancy because it sees or retains the original numbering.

Real-world example from #87790

In the original report, the agent was responding to selected items from an earlier numbered discussion. Its raw response deliberately preserved the original references:

1. Noted — and probe7's report contained no note ...
5. Yes, both runtimes ...
6. Both layers ran ...
8. Fair challenge ...

The TUI displayed that same response as:

1. Noted — and probe7's report contained no note ...
2. Yes, both runtimes ...
3. Both layers ran ...
4. Fair challenge ...

The user then asked whether the displayed 2. referred to a different item in the original 1–8 discussion. The agent answered that it had not written a 2.—because, in its raw response, it had written 1., 5., 6., and 8.. The renderer had silently changed the numbers between generation and display, creating the apparent contradiction.

Additional Information

  • The renderer is applying ordinary ordered-list normalization to conversational text whose literal numbers carry referential meaning.
  • The relevant component boundary is the chat Markdown renderer; this draft does not assume a specific implementation such as Ink.
  • The fix should preserve ordinary ordered-list rendering where sequential list formatting is intended, while preventing the renderer from silently changing literal conversational references.
  • Related reports:
  • #87790 — original report
  • #92855 — subsequent report of the same underlying issue

Environment

  • Claude Code Version: 2.1.280
  • OS: Linux, macOS, Windows
  • Interface: Claude Code CLI - Terminal TUI (Ink)

View original on GitHub ↗