[BUG] Markdown shown in planning mode inconsistent from plan file actual content.

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

Plan mode's markdown rendering silently corrects malformed ordered list numbering, making the display diverge from the file content.

This masks edit errors and breaks the assumption that what you see is what's in the file.

The core of it:

  • Plan mode renders the plan file as CommonMark markdown
  • CommonMark auto-numbers ordered lists sequentially regardless of source numbers
  • This means the display can show correct 14, 15, 16, 17 while the file contains 14, 15, 14, 15
  • Neither the user nor the agent can detect the discrepancy from the rendered view
  • Downstream consumers reading the raw file get different content than what was displayed

What Should Happen?

The plan mode display should show the raw file content faithfully, not a markdown-rendered interpretation of it. Specifically:

Option A (preferred): Display ordered list numbers exactly as written in the file. If the source contains 14, 15, 14, 15, the display should
show 14, 15, 14, 15 — not silently renumber them to 14, 15, 16, 17. This makes edit errors immediately visible to the user.

Option B (acceptable): If markdown rendering is intentional, the renderer should write the corrected content back to the file so the display
and file stay in sync. If the renderer decides to display 16, 17, the file should also contain 16, 17.

The current behavior violates the principle of least surprise: the user reviews and approves a plan based on what they see in the display,
but the actual file content — which agents and tools consume downstream — differs silently.

Error Messages/Logs

Steps to Reproduce

  1. Enter plan mode
  2. Edit the plan file to contain an ordered list with duplicate numbers (e.g. 14. ... 15. ... 14. ... 15. ...)
  3. View the plan via /plan or ExitPlanMode — display shows auto-corrected sequential numbering (14, 15, 16, 17)
  4. Read the raw file — it still contains 14, 15, 14, 15

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.50 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

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