[BUG] Claude Code Misinterprets <error> and <name> XML Tags When Reading Files
Bug Report:
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [x] Other: Claude Code CLI
- Claude CLI version: 0.2.117
- Operating System: macOS Sequoia 15.4.1
- Terminal: iTerm
Bug Description
There's a bug in Claude Code where it incorrectly interprets XML tags when reading file contents. Specifically, it interprets <error> tags as <e> and <name> tags as <n>. As a result, Claude continuously suggests correcting the valid tags (<error>, <name>) and attempts various workarounds.
Steps to Reproduce
- Install and run Claude Code 0.2.117
- Create a file containing
<error>or<name>tags - Execute a file reading command in Claude Code
- Observe Claude's response to the file contents
Expected Behavior
Claude Code should correctly recognize and interpret the <error> and <name> tags in file contents exactly as they are.
Actual Behavior
Claude Code misinterprets <error> tags as <e> and <name> tags as <n>. This causes Claude to repeatedly suggest changing the tags to <error> and <name>, and it fails to properly process the original file contents.
Additional Context
This issue is particularly problematic when processing files that use XML or HTML tags. Claude's misinterpretation of these tags makes accurate parsing impossible, creating difficulties in understanding or modifying file contents correctly.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗