[BUG] Terminal markdown renderer silently destroys ~40% of GFM features the system prompt claims are supported
The Problem
The system prompt tells the model it has full GitHub-flavored markdown:
"You can use Github-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification."
The terminal renderer supports about 60% of GFM. The model uses the other 40% — headers for hierarchy, link labels for context, strikethrough, task checkboxes — and the renderer silently strips them. The model has no feedback channel to observe its own rendered output, so it keeps using features that don't work.
Reproduction
The model outputs this markdown:
## Migration Overview
The v2 API replaces the legacy auth flow.
### What's New
- Token-based auth replaces session cookies
- ~~`/api/v1/auth/session`~~ has been removed
### Steps
- [x] Update SDK to v2.3+
- [ ] Migrate stored credentials
- [ ] Run integration tests
See the [migration guide](https://docs.example.com/v2/migration) for details.
The terminal renders it as:
Migration Overview ← bold
(no hierarchy distinction ↓)
What's New ← bold (identical)
– Token-based auth replaces session cookies
– ~~`/api/v1/auth/session`~~ has been removed ← raw tildes
Steps ← bold (identical)
– Update SDK to v2.3+ ← no checkbox state
– Migrate stored credentials
– Run integration tests
See the https://docs.example.com/v2/migration for details.
↑ "migration guide" label discarded, grammar broken
Five things lost: header hierarchy, strikethrough, task checkbox state, link labels, and — in the link case — grammatically correct English ("See the [bare URL] for details").
<img width="1148" height="771" alt="Image" src="https://github.com/user-attachments/assets/12398578-2573-4e95-84c8-493576b68915" />
<img width="1144" height="992" alt="Image" src="https://github.com/user-attachments/assets/47adfb24-dd2b-4a79-b6bd-85031156732f" />
You can reproduce this yourself. Paste the markdown block above into any Claude Code session and compare the rendered output to what GitHub shows.
What Works vs What Doesn't
Works: bold, italic, bold-italic, code spans, fenced code blocks with syntax highlighting, diff blocks, tables, bulleted/numbered lists, single-level blockquotes.
Broken:
| Element | Model writes | User sees |
|---|---|---|
| Headers h2–h6 | ## Section / ### Detail | Identical bold text, no hierarchy |
| Link labels | [guide](url) | Raw URL, label discarded |
| Strikethrough | ~~old~~ | Literal ~~old~~ with tildes |
| Task lists | - [x] / - [ ] | Both render as plain bullets |
| Nested blockquotes | > > > deep | All levels identical |
| HTML entities | & © | Raw entity text verbatim |
Suggested Fixes
1. Update the system prompt (zero code changes, highest leverage)
Replace the current GFM claim with an accurate description of what the renderer supports and what it doesn't. The model adapts immediately. This could ship as a prompt-only update.
2. Renderer improvements (separate, lower priority)
- Preserve link labels (render as
label: urlor just the label) - Differentiate header levels (bold-italic for h1, bold for h2, etc.)
- Render
~~strikethrough~~via ANSI strikethrough - Preserve
[x]/[ ]checkbox state - Increase indent per blockquote nesting level
- Decode HTML entities
Fix #1 alone resolves the issue. The model stops using features that don't work. Fixes #2+ are nice-to-haves that would expand what the model can use.
Environment
- OS: macOS (Darwin 24.6.0, ARM64)
- Tool: Claude Code CLI, February 2026
- Terminal: Default dark theme
Related: #19251, #17554, #25997
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗