[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
<img width="1260" height="969" alt="Image" src="https://github.com/user-attachments/assets/d1a1353c-ca39-4e5f-ab84-eae5a4b74d31" />
│
## 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 /agents command
- 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
/agents command
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗