[BUG] /agents command incorrectly parses/renders markdown in agent instructions
Bug Description
When checking agent instructions using the /agents command, markdown syntax is incorrectly processed, resulting
in missing content sections and fragmented text display.
Specific Pattern Observed
- YAML header section displays normally
- Markdown headers (#) immediately after YAML are stripped/missing
- Regular text content appears partially with broken sentence structure
- Markdown components like # are selectively filtered out
- Content appears fragmented and incomplete
Visual Evidence
The /agents command output shows:
- YAML frontmatter renders correctly
- Content appears fragmented (e.g., "ection", "on, complexity", "dependencies, interfaces, error patterns")
- Missing context and broken sentence flow
- Incomplete instruction display
│
Steps to Reproduce
- Use Claude Code for some time with agent interactions
- When Claude Code's behavior becomes erratic (subagents not following instructions properly, unpredictable
responses, etc.), check
/agentscommand - This markdown parsing issue is observed every time such performance issues are detected
- Compare with direct file reading of the same agent files - they show complete content
Workarounds and Recovery
/resetor restarting Claude does NOT resolve the issue/clearcommand does NOT resolve the issue- Completely closing the command prompt and restarting sometimes resolves it (but not always)
- When complete restart doesn't work, waiting approximately 1 hour often resolves the issue
- Interesting observation: On one occasion, the issue suddenly resolved exactly at the 50-minute mark (may be coincidental, but worth noting)
Impact
- Agent instructions appear incomplete to users
- May affect Claude's internal processing of agent capabilities
- Direct file reading shows complete content correctly
- Correlates with Claude Code performance degradation
- Standard reset/clear commands cannot resolve the issue
Environment
- Platform: Windows (win32)
- Operating System: Windows
- Claude Code version: Latest
Expected Behavior
/agents command should display complete agent instructions including all markdown formatting and headers
Actual Behavior
Markdown headers are stripped, content is fragmented, and instructions appear incomplete with broken sentence structure
Additional Notes
- This appears to be tied to Claude Code's internal state or session management
- The issue manifests when Claude Code's behavior becomes unpredictable or subagents fail to follow instructions properly
- Standard troubleshooting commands (reset/clear) are ineffective
- May be related to session timeout or cache invalidation mechanisms (possibly explaining the ~50-minute recovery observation)
- Direct file access shows complete content, indicating the issue is in the display/parsing layer of the
/agentscommand
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.